Help with 'if Request.Form' on form

This is a discussion on "Help with 'if Request.Form' on form" within the Classic ASP section. This forum, and the thread "Help with 'if Request.Form' on form are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Apr 21st, 2008, 10:46
Up'n'Coming Member
Join Date: Jan 2006
Location: Belfast
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Help with 'if Request.Form' on form

Hi all,

I have a form through ASP where users enter their home and mobile phone number.

For the other fields, I use the following script to get them to enter the details if they leave it blank:

if Request.Form("PostalCode") = "" then strErrorMessage = strErrorMessage & "<p>Please enter
your Postal Code.</p>"

How can I do it so that if both the home and mobile number is empty, it says 'Please enter one contact number' - otherwise if only one is filled in, it allows it to go through?!

All advice and help welcomed!

Thanks

Ben
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Apr 21st, 2008, 13:23
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,668
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Help with 'if Request.Form' on form

Code: Select all
If Request.Form("HomeNumber") = "" And Request.Form("MobileNumber") = "" Then
 strErrorMessage = strErrorMessage & "<p>Please enter one contact number.</p>"
End If
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 21st, 2008, 14:01
Up'n'Coming Member
Join Date: Jan 2006
Location: Belfast
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with 'if Request.Form' on form

that is fantastic - many thanks for that!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding / Showing form fields based on previous form input John Alexander Hopper PHP Forum 1 Mar 10th, 2008 11:30
form variable within an iframe component of a form kissfreaque JavaScript Forum 5 Feb 29th, 2008 11:57
[SOLVED] PHP contact form redirect to same form Posie PHP Forum 14 Jan 29th, 2008 20:28
ASP form to check weather a form value is already in the database Andrew1986 Classic ASP 3 Oct 25th, 2007 08:23
request.form fails ppetree Classic ASP 1 Mar 15th, 2007 11:19


All times are GMT. The time now is 05:48.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42