|
|
Please consider registering: registration is fast, easy and free! Benefits of registration:
- Free advertising for your website: Every post in our forums goes towards a "credit" of ads, which are displayed on most pages of our forums. Each post gives you 400 ad impressions. To submit your ad, edit your profile.
- Discount at TemplateMonster: All our members enjoy a 10% discount at TemplateMonster.com!
|
- Private Messages: Exchange private messages with other members of the forums.
- Message Tracking/Subscription: phpBB enables you to subscribe to threads which interest you, and will then email you when a reply is posted. phpBB also remembers which posts registered users have read during a session, which means you can keep track of which posts you have already looked at.
|
|
| Author |
Message |
Justin
4WebHelp Addict

Joined: 07 Jan 2002
Posts: 991
|
Posted:
Sun Oct 27, 2002 12:58 am (10 years, 7 months ago) |
  |
Hi,
Is there any way that I can make FormMail send an IP address with the mail it sends to the recipent when it is filled in.
Also is there a way I can make the email field compulsary on a feedback form such as the one I am using at http://www.bluesweb.co.uk/forms/feedback.php, IE so if you leave the email field blank it doesn't let you send the form?
Thanks! |
|
|
     |
 |
Darren
Team Member


Joined: 05 Feb 2002
Posts: 610
Location: London
|
Posted:
Sun Oct 27, 2002 1:14 pm (10 years, 7 months ago) |
  |
I assume you want something in Javascript for the validation. Someone wrote this for me once, which might do the trick. Could be much simpler for just one field.
Stick this in the head
| Code: | <script language="JavaScript">
<!--
function validateForm() {
var warning = "";
if(document.frm.name.value == "") {
warning = "\nName";
}
if(document.frm.email.value == "") {
warning += "\nE-mail address";
}
if(document.frm.address.value == "") {
warning += "\nAddress";
}
if(document.frm.postcode.value == "") {
warning += "\nPostal Code";
}
if(document.frm.fax.value == "") {
warning += "\nFax";
}
if(document.frm.tel.value == "") {
warning += "\nWork/Home number";
}
if(warning != "") {
alert("You must fill in the following fields:\n" + warning + "\n\nPlease try again.");
} else {
document.frm.submit();
}
}
//-->
</script> |
This is the form
| Code: | <form name="frm" method="post" action="">
<input type="text" name="name" class="forms" size="30">
<input type="text" name="email" class="forms" size="30">
<textarea name="address" class="forms" cols="30" rows="4" wrap="VIRTUAL"></textarea>
<input type="text" name="postcode" class="forms" size="30">
<input type="text" name="tel" class="forms" size="30">
<input type="text" name="fax" class="forms" size="30">
<input type="submit" name="Submit" value="Submit" class="forms" onClick="validateForm();return false;">
</form> |
Of course it only checks that the fields aren't empty. |
|
|
     |
 |
Justin
4WebHelp Addict

Joined: 07 Jan 2002
Posts: 991
|
Posted:
Sun Oct 27, 2002 3:52 pm (10 years, 7 months ago) |
  |
Cheers Darren, I'll try that when I get a minute!  |
|
|
     |
 |
adam
Forum Moderator & Developer

Joined: 26 Jul 2002
Posts: 858
Location: UK
|
Posted:
Tue Oct 29, 2002 6:43 pm (10 years, 7 months ago) |
  |
just a note about relying on JavaScript to validate forms...while it may be quicker than submitting and waiting, it can be easily by-passed...
also: what if the user doesn't support JavaScript? or has it turned off for some reason? the form won't be validated...I suggest using php instead. |
________________________________ It's turtles all the way down... |
|
     |
 |
Justin
4WebHelp Addict

Joined: 07 Jan 2002
Posts: 991
|
Posted:
Mon Nov 25, 2002 6:00 pm (10 years, 6 months ago) |
  |
| Justin wrote: | | Is there any way that I can make FormMail send an IP address with the mail it sends to the recipent when it is filled in. |
Anyone? |
|
|
     |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2192
Location: London, UK
|
Posted:
Mon Nov 25, 2002 7:13 pm (10 years, 6 months ago) |
  |
|
     |
 |
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.035692 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |