 |
|

01-26-2006, 01:21 PM
|
|
SEO Junior
|
|
Join Date: Sep 2005
Location: London
Posts: 11
|
|
|
How do I make fields mandatory on a form?
Hi I have a contact us form that emails me when submitted. However I want to make one of the fields mandatory so that if it isn't filled in it won't let you submit the form. However I not sure how to do it. Could anyone point me in the right direction?
Molly
__________________
 Sorry spelling not my strong point!
|

01-26-2006, 02:17 PM
|
 |
SEO GUY Moderator
|
|
Join Date: May 2004
Location: Tampa Bay
Posts: 2,847

|
|
|
|

01-26-2006, 02:39 PM
|
|
SEO Junior
|
|
Join Date: Sep 2005
Location: London
Posts: 11
|
|
|
Cheers I'm going to try the second one.
__________________
 Sorry spelling not my strong point!
|

03-25-2006, 04:57 PM
|
|
SEO Junior
|
|
Join Date: Sep 2005
Posts: 2
|
|
|
Don't forget that JavaScript validation is non-existent if someone wants to copy your page and fiddle the Javascript before they submit the form. Server-side validation is the only reliable validation. Maybe this isn't a serious issue in your case. Something to consider where authentication and money is involved.
|

06-19-2006, 04:44 AM
|
 |
SEO
|
|
Join Date: Jan 2006
Posts: 268
|
|
|
It depends on whether you are making the form in asp.net or php
|

06-19-2006, 08:18 AM
|
 |
SEO GUY Moderator
|
|
Join Date: May 2004
Location: In perpetual style
Posts: 3,305
|
|
Quote:
|
Originally Posted by mikhail
Don't forget that JavaScript validation is non-existent if someone wants to copy your page and fiddle the Javascript before they submit the form. Server-side validation is the only reliable validation. Maybe this isn't a serious issue in your case. Something to consider where authentication and money is involved.
|
Uh...no. They can not modify the script becuase it is on your server. Downloading and changing it will have no affect because the form pulls it from the server.
|

06-27-2006, 12:58 PM
|
 |
SEO Junior
|
|
Join Date: Jun 2006
Posts: 22
|
|
Quote:
|
Originally Posted by jlknauff
Uh...no. They can not modify the script becuase it is on your server. Downloading and changing it will have no affect because the form pulls it from the server.
|
I think what mkhail meant was that you can copy and paste the code, make changes, and upload to your server. Then set the action on the form to a full path, for example: http://www.someoneelsessite.com/process.php
Most forms don't verify that the HTTP_REFERRER was in fact not an external site. All someone would be doing is posting the form variables to your script, and bypassing any sort of javascript validation.
A little unlikely, yes, but it is possible.
|

06-27-2006, 01:20 PM
|
 |
SEO GUY Moderator
|
|
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,111

|
|
Quote:
|
Originally Posted by ixpleo
<snip> Most forms don't verify that the HTTP_REFERRER was in fact not an external site. All someone would be doing is posting the form variables to your script, and bypassing any sort of javascript validation.
A little unlikely, yes, but it is possible.
|
Good point, but actually, it's not so unlikely. A lot of spammers who can't get hosting are using this backdoor method to send unsolicited emails.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
|

08-26-2006, 04:04 PM
|
 |
SEO Junior and a half
|
|
Join Date: May 2006
Posts: 69
|
|
|
Javascript is how you can validate the the fields were filled out on the client side. If you use PHP, PERL, ASP, or another cgi language, you could validate on the server side, but if you find a problem, your server side script will have to generate a page that shows a message to the user.
Javascript is the most popular option.
|

08-26-2006, 04:41 PM
|
 |
SEO GUY Moderator
|
|
Join Date: May 2004
Location: Tampa Bay
Posts: 2,847

|
|
Quote:
|
Originally Posted by Molly
..I want to make one of the fields mandatory so that if it isn't filled in it won't let you submit the form..
|
.
|
 |
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|