4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Getting FormMail to Send IP Addresses
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Oct 27, 2002 12:58 am (15 years, 1 month ago) Reply with QuoteBack to Top

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!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Sun Oct 27, 2002 1:14 pm (15 years, 1 month ago) Reply with QuoteBack to Top

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.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Oct 27, 2002 3:52 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Cheers Darren, I'll try that when I get a minute! Smile
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Tue Oct 29, 2002 6:43 pm (15 years, 1 month ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Mon Nov 25, 2002 6:00 pm (15 years ago) Reply with QuoteBack to Top

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?
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Mon Nov 25, 2002 7:13 pm (15 years ago) Reply with QuoteBack to Top

Is this what you're looking for?

http://www.scriptarchive.com/readme/formmail.html#form_config

It has info on providing the IP and required fields.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.056954 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme