Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 03-01-2008, 09:30 PM
kiwinvan kiwinvan is offline
Hatchling Croc
 
Join Date: Feb 2008
Posts: 4
Default Some help with formmail - pleaaase

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.
Reply With Quote
  #2  
Old 03-02-2008, 01:21 AM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,163
Default Re: Some help with formmail - pleaaase

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
Reply With Quote
  #3  
Old 03-02-2008, 03:11 PM
episkey episkey is offline
Junior Croc
 
Join Date: Feb 2008
Posts: 133
Default Re: Some help with formmail - pleaaase

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">
Reply With Quote
  #4  
Old 03-03-2008, 02:07 PM
kiwinvan kiwinvan is offline
Hatchling Croc
 
Join Date: Feb 2008
Posts: 4
Default Re: Some help with formmail - pleaaase

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.
Reply With Quote
  #5  
Old 03-03-2008, 02:58 PM
kiwinvan kiwinvan is offline
Hatchling Croc
 
Join Date: Feb 2008
Posts: 4
Default Re: Some help with formmail - pleaaase

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.
Reply With Quote
  #6  
Old 03-03-2008, 03:17 PM
jimbug's Avatar
jimbug jimbug is offline
Baby Croc
 
Join Date: Jan 2008
Location: California, USA
Posts: 83
Default Re: Some help with formmail - pleaaase

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
__________________
Jim
http://www.jimbug.org/

Last edited by jimbug; 03-03-2008 at 03:21 PM.
Reply With Quote
  #7  
Old 03-03-2008, 04:08 PM
Dwight's Avatar
Dwight Dwight is offline
Swamp Croc
 
Join Date: Apr 2005
Location: Menifee, California
Posts: 241
Default Re: Some help with formmail - pleaaase

Quote:
Originally Posted by kiwinvan View Post
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.
Okay, this *IS* Javascript, but it's nothing to be afraid of.. if you can use formmail, you should be able to do this.. I use this script all the time for my forms..

http://www.dynamicdrive.com/dynamici...uiredcheck.htm
__________________
===================
Dwight Jenkins
Rainbow Flair Web Design
===================
Reply With Quote
  #8  
Old 03-03-2008, 07:36 PM
kiwinvan kiwinvan is offline
Hatchling Croc
 
Join Date: Feb 2008
Posts: 4
Default Re: Some help with formmail - pleaaase

Quote:
Originally Posted by Dwight View Post
Okay, this *IS* Javascript, but it's nothing to be afraid of.. if you can use formmail, you should be able to do this.. I use this script all the time for my forms..

http://www.dynamicdrive.com/dynamici...uiredcheck.htm
Perfect - thanks very much Dwight! As confusing as it looked to me - it's doing exactly what I wanted.
Cheers!
Reply With Quote
Reply

Bookmarks

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 Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 10:39 AM.

 
Forum SEO by Zoints