Print Page | Close Window

determining whether a form field is blank

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=12616
Printed Date: 30 March 2026 at 7:51pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: determining whether a form field is blank
Posted By: cullie140
Subject: determining whether a form field is blank
Date Posted: 19 November 2004 at 8:44pm

I am making a form for my website and I am trying to find a way to figure whether or not a form field was left blank or not mainly for validation purposes.

What I actually have is a form field First and I want to be sure a user types a first name. NO javascipt because this is for e-com. thanks for any help.




Replies:
Posted By: Gullanian
Date Posted: 19 November 2004 at 8:48pm
Dim strFormFieldValue

strFormFieldValue = Request.form("fieldName")
If strFormFieldValue = "" then
    'Form field wasn't edited
Else
    'Form field was edited
End if


Posted By: dpyers
Date Posted: 19 November 2004 at 11:05pm
You may want to change
strFormFieldValue = Request.form("fieldName")
to
strFormFieldValue = Trim(Request.form("fieldName"))
to get rid of any spaces the user may have entered

-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net