Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Form error

Status
Not open for further replies.

sondev

IS-IT--Management
Jan 7, 2005
22

<form method="post" action="mailto:<recipient>">
<input type="hidden" name="subject" value="Contact Form" />
<table width="533" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="180" valign="top">Recipient email</td>
<td width="353" valign="top"><input type="text" size="35" maxlength="256" name="recipient" /></td>
</tr>
<tr>
<td width="180" valign="top">Tech name</td>
<td width="353" valign="top"><input type="text" size="35" maxlength="256" name="TECH NAME" /></td>
</tr>
<tr>
<td width="180" valign="top">Tech email</td>
<td width="353" valign="top"><input type="text" size="35" maxlength="256" name="TECH EMAIL" /></td>
</tr>

<tr>
<td width="353" valign="top"><input type="submit" value="Send Message" /> &nbsp; <input type="reset" value="Clear Form" /></td>
</tr>
</table>
</form>

*** I have this form on my page. However, i need this form to submit to the email address in the recipient field. Currently it says it is submitting, but no action occurs. I believe i did not design this form properly where it states:

<form method="post" action="mailto:<recipient>">

If any of you have an answer to how I can auto submit to whatever address is located in the recipient box, please let me know. thanks.
 
Have you tried this?

Code:
<td width="353" valign="top"><input type="text" size="35" maxlength="256" name="TECH EMAIL" [blue]onBlur="document.forms[0].action='mailTo:" + this.value + "'[/blue]"/></td>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
zen.gif

 
Mwolf00,

I tried to inputting your comments and it did not work. Still unable to submit the form. It is not even showing an error. It simply does not submit??
 
What do these alerts tell you?
Code:
<script language=javascript>
	function subForm(){
		toEmail = document.myForm.recipient.value
		alert(toEmail)
		document.myForm.action = "mailTo:" + toEmail
		alert(document.myForm.action)
		return true
	}

</script>

<form method="post" [blue]onSubmit="return subForm()" name="myForm"[/blue]>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
zen.gif

 
BTW - this should really be in the javascript forum...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
zen.gif

 
This is what I am getting... I can get the form to submit using your advice. It will give me two warnings showing the email address, and then prompt me to continue. The code seems to work good enough, although the form is sending as an ATT attachment with data all in one line.

I had to remove:
'onBlur="document.forms[0].action='mailTo:" + this.value + "'"/'
I was not getting any response from this comment.

I would also like to add a subject in the email other then the default "Form Posted from Internet Explorer". Let me knowif you have any other advice. thanks.
 
The subject line is easy to add...

document.myForm.action = "mailTo:" + toEmail + "?subject=Form Posted from Internet Explorer"


But the resulting email cannot be formated. Are you able to handle the form via ASP and send and email from there?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
zen.gif

 
I am able to send mail from the form. As far as handling the form via ASP, I am not sure what that means. I have a form setup on an asp page. Unfortunately the form is sending as an attachment and not in the form of an email. I would like to be able to format it so that it writes directly to the mail in proper format. Thanks for that note on adding the subject. Need to do some more research on the rest of this stuff.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top