Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old April 21st, 2008, 06:46 AM   #1
WebForumz Member
 

Join Date: Jan 2006
Location: Belfast
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 sing2trees is on a distinguished road
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
sing2trees is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 21st, 2008, 09:23 AM   #2
Most Reputable Member
 
spinal007's Avatar
 

Join Date: Mar 2004
Location: Good Ol'London
Age: 24
Posts: 1,684
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Rep Altering Power: 0 spinal007 has a spectacular aura about spinal007 has a spectacular aura about
Re: Help with 'if Request.Form' on form

Code:
If Request.Form("HomeNumber") = "" And Request.Form("MobileNumber") = "" Then
 strErrorMessage = strErrorMessage & "<p>Please enter one contact number.</p>"
End If
__________________
Diego - Web-Developer & London SEO Expert
jQuery Plugins: Multiple File Upload, Star Rating, FCKEditor | NEW: XML to JSON
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 21st, 2008, 10:01 AM   #3
WebForumz Member
 

Join Date: Jan 2006
Location: Belfast
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 sing2trees is on a distinguished road
Re: Help with 'if Request.Form' on form

that is fantastic - many thanks for that!!!
sing2trees is offline  
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

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 1 March 10th, 2008 08:30 AM
form variable within an iframe component of a form kissfreaque JavaScript 5 February 29th, 2008 07:57 AM
[SOLVED] PHP contact form redirect to same form Posie PHP 14 January 29th, 2008 04:28 PM
ASP form to check weather a form value is already in the database Andrew1986 Classic ASP 3 October 25th, 2007 04:23 AM
request.form fails ppetree Classic ASP 1 March 15th, 2007 08:19 AM


Search Engine Optimization by vBSEO 3.2.0 RC8