Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: mailto

  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Question mailto

    Please can someone help?

    I have a simple form that uses the "mailto" to send the info.
    Not practical I know, but the problem I have is once the form has been validated and the user goes to submit the info, they are alert by the message to say that your are about to send info by email.


    Firstly can this message be eliminated? or the problem I have is when the cancel button is click the info that is type in the form is lost

    is there a way round this?
    Kind regards,
    Mike Hughes

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    The message can't be eliminated because it's a security issue but you can work around it by using, perhaps, a form redirection service like Bravenet.com (free) or another language like PHP (requires PHP host).
    Last edited by zoobie; 09-12-2002 at 04:32 PM.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey " hughesmi",

    i have just designed a form using php, because i had the same problem with html. it's fairly easy, if u dont know php, u can just put the code in the page, and adapt the obvious areas. have included it below. (I actually got help for this from the php forum! lol)

    <?
    if(!isset($submit)){
    ?>
    <form action="<?=$PHP_SELF.'?'.$QUERY_STRING?>" method="post">
    <input type="text" name="name">

    <input type="text" name="email">

    <input type="submit" value="Submit" name="submit">
    </form>
    <?
    }else{
    $myemail = "you@yourdomain.co.uk";
    $subject = "You have a message from $name";
    $body = "$name has sent you the following information.


    His/her email is: $email";
    mail($myemail,$subject,$body,"From: $email");
    }
    ?>



    SJC
    __________________

    Contraban.co.uk is launched!

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh dear...
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #5
    umm
    umm is offline
    Regular Coder
    Join Date
    Sep 2002
    Location
    Antipodes
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This might help. It won;t eliminate the security alert (as far as I know, it can't be done with the mailto link).

    Code:
    <script language="javascript" type="text/javascript">
    <!--
    function  validate(form){
    	if(form.email.value==""){
    		alert("email is a Required Field");
    		form.email.focus();
    		return false;
    	} else
    	if(form.comments.value==""){
    		alert("Comments is a Required Field");
    		form.comments.focus();
    		return false;
    	}
    return (confirm("Is this Correct\rEmail Address: "+form.email.value))? true:  false;
    }
    //-->
    </script>
    ..with this form...

    <form action="mailto:blah@blah.net" enctype="text/plain" method="post" onsubmit="return validate(this)">

    <table width="50%" border="1" align="center">

    <tr>
    <th><label for="emailAddress">Email Address</label></th>
    <td><input type="text" name="email" id="emailAddress"></td>
    </tr>

    <tr>
    <th><label for="commentsArea">Comments</label></th>
    <td>
    <textarea name="comments" id="commentsArea" cols="30" rows="5"></textarea>
    </td>
    </tr>

    <tr>
    <th>Submission</th>
    <td align="center">
    <input type="submit" value="Send">
    <input type="reset" value="Clear">
    </td>
    </tr>

    </table>
    </form>
    Last edited by umm; 09-12-2002 at 10:31 PM.

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Lightbulb could work

    This might be a soultion for me, but how I make the

    return (confirm("Is this Correct\rEmail Address: "+form.email.value))? true: false;
    }

    work to display all the required fields?


    I have tryed to make it work.

    code:-----------------------------------------------------------------------------
    <script language="javascript" type="text/javascript">
    <!--
    function validate(form){
    if(form.email.value==""){
    alert("email is a Required Field");
    form.email.focus();
    return false;
    } else
    if(form.comments.value==""){
    alert("Comments is a Required Field");
    form.comments.focus();
    return false;
    }
    return (confirm("Is this Correct\rEmail Address: "+form.email.value))? true: false;
    }
    //-->
    </script>
    --------------------------------------------------------------------------------


    ..with this form...

    <form action="mailto:blah@blah.net" enctype="text/plain" method="post" onsubmit="return validate(this)">

    <table width="50%" border="1" align="center">

    <tr>
    <th><label for="emailAddress">Email Address</label></th>
    <td><input type="text" name="email" id="emailAddress"></td>
    </tr>

    <tr>
    <th><label for="commentsArea">Comments</label></th>
    <td>
    <textarea name="comments" id="commentsArea" cols="30" rows="5"></textarea>
    </td>
    </tr>

    <tr>
    <th>Submission</th>
    <td align="center">
    <input type="submit" value="Send">
    <input type="reset" value="Clear">
    </td>
    </tr>

    </table>
    </form>
    Kind regards,
    Mike Hughes

  • #7
    umm
    umm is offline
    Regular Coder
    Join Date
    Sep 2002
    Location
    Antipodes
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, the technique we use will depend on what type of information the fields contain. For example, if you had a textarea for comments, the potential length of the field might make displaying that information in a confirm dialogue unweildy. You might want to go for a popup window in that case and submit or cancel from there.

    On the other hand, if you want to confirm small fields like email address, a dialogue may be sufficent.

    What fields will you want to display and how long will they potentially be?

    Anyway, try out the confirm with some more values:

    Code:
    function validate(form){ 
    	if(form.email.value==""){ 
    		alert("email is a Required Field"); 
    		form.email.focus(); 
    		return false; 
    	} else
    	 if(form.comments.value==""){ 
    		alert("Comments is a Required Field");
     		form.comments.focus(); 
    		return false; 
    	} 
    	var msg="Is this Correct"
    	msg+="\rEmail Address: "+form.email.value
    	msg+="\rComments: "+form.comments.value
    	return (confirm(msg))? true: false; 
    }
    try that script with the same form as before. Put plently of comment in the "comments" textarea to see what you think.
    Last edited by umm; 09-13-2002 at 11:39 AM.

  • #8
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    there is a way around the all your text field clearing when you click cancel.
    Example
    http://www.freewebs.com/dhcs/funmail/funmail.html

    simple script manipulation.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •