Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2004, 08:59 PM
Authorized User
 
Join Date: Jul 2003
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default Checking for Empty Field

How do you check Request.Form("field") for blanks using vbScript?

It's easy to do with JavaScript.
In the header you place the functions
function isBlank(strObject) {
 var re = /\S+/;
   if (!strObject) return true;
   if (re.test(strObject.value)) return false;
   else return true;
}
And then
If (isBlank(Request.QueryString("field")){
  Do this;
}

 
Old March 12th, 2004, 01:42 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<%
If (Request("field") = "") Then
    ' field is blank
End If
%>

 
Old March 15th, 2004, 01:16 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This is a confusing question...

Do you mean vbScript in the client or on the server? Mentioning JavaScript kind of confuses the question.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking to see if a label's text is empty mh JSP Basics 2 October 26th, 2005 11:05 AM
Checking to see if a label's text is empty mh ASP.NET 2.0 Basics 2 October 26th, 2005 10:38 AM
Help checking for empty dataset Payback ASP.NET 1.0 and 1.1 Basics 5 March 28th, 2005 05:00 AM
Checking for empty string richw32001 General .NET 1 August 8th, 2004 01:37 PM
checking for empty recordsets ! spraveens Classic ASP Databases 0 September 9th, 2003 10:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.