|
#1
|
|||
|
|||
|
Not sure if this is the right space. I have managed to get a contact form going with name, email address, phone number and message. Can anyone tell me how I can make it so that these fields are required to be filled in and if they are not to get an error message like "email address required".
Thanks. |
|
#2
|
||||
|
||||
|
Are you looking to do this with javascript (pop-up warning) or on the results page? Do you know the difference/care?
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#3
|
|||
|
|||
|
As slapshotw has indicated, there are two ways to do this. One way is with a javascript, but that's not an option unless you know something about javascript.
The other way is to include an input in your form that has the following fields: type=hidden name="required" value="[list of field names you want to be required]" For example, suppose you had the following lines in your form: <input type="text" name="name" size="20" value="Name"> <input type="text" name="email" size="20" value="Email"> To make name and email required, you would add this line: <input type=hidden name="required" value="name,email"> |
|
#4
|
|||
|
|||
|
Thanks! I know NOTHING about javascript. I think what you have written, episkey is what I'm looking for.
I'll have a go and see if it works for me. |
|
#5
|
|||
|
|||
|
Yes that works but I think I'm looking for something tidier if they make a mistake. For example I have a redirect to a Thank you page when they send their email. If the name or email areas are incomplete, I would like a separate page to load saying to use their back browser to go back and complete the form.
Any ideas? Thanks. |
|
#6
|
||||
|
||||
|
You might take a look at this thread...
http://forums.hostgator.com/showthread.php?t=28738 I started it to see what other people use to process their forms. Hopefully more people will contribute to it. I write my own scripts or modify the ones produced by my Quick SM program. I haven't used formail in about 10 years. Edit: I even forgot how to spell it-formmail Last edited by jimbug; 03-03-2008 at 03:21 PM. |
|
#7
|
||||
|
||||
|
Quote:
http://www.dynamicdrive.com/dynamici...uiredcheck.htm
__________________
=================== Dwight Jenkins Rainbow Flair Web Design =================== |
|
#8
|
|||
|
|||
|
Quote:
Cheers! |
![]() |
| Bookmarks |
| Thread Tools | |
|
|