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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forms

Status
Not open for further replies.

alan28

Technical User
Jul 31, 2002
60
GB
I want to give the user the option to send a form to different people thought a drop down list. Anyone know how to do this?
 
change the recipient form value on the selected value
ie
frm.recipient.value = frm.selectname.options[frm.selectname.selectedIndex].value; I dare to learn more
admin@onpntwebdesigns.com
 
Do you mean something like this:

<HTML><HEAD><TITLE></TITLE>
<BODY>
<SCRIPT language=javascript>

function popmessage(emailvalue){
if (emailvalue == 'none')
{ alert('Choose an email !!')
}
else
{
var doc = &quot;mailto:&quot;

doc = doc + document.webform.email.value;

doc = doc + &quot;?subject=MySubjectText&quot;;
doc = doc + &quot;&body=Text 1: &quot; + webform.text1.value;
doc = doc + &quot;%0d&quot;;
doc = doc + &quot;Text 2: &quot; + webform.text2.value;
window.location.href = doc;
}
}


</SCRIPT>


<FORM name=webform action=javascript:popmessage(webform.email.options[webform.email.selectedIndex].value)><BR>
<select name=&quot;email&quot; >
<option value=&quot;none&quot; selected>-- Choose email --</option>
<option value=&quot;email1&quot;>email1@domain1</option>
<option value=&quot;email2&quot;>email2@domain2</option>
<option value=&quot;email3&quot;>email3@domain3</option>
</select><BR>
<INPUT name=text1><BR>
<INPUT name=text2><BR>

<INPUT type=submit value=&quot;Submit Form&quot; name=mysubmit>
</FORM>
</BODY></HTML>

Hope this helps,
Erik <-- My sport: Boomerang throwing !!
!! Many Happy Returns !! -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top