View Full Version : Drop Down Form Trouble
kam31uf
07-23-2002, 12:44 AM
I was asked to create a series of simple drop down menus. One of them will be just email addresses. Here is what i have so far, but I notice that its not working. I think I need to change the VALUE but i dont know what to change it to.
<select name="select" onChange="location=document.nav.link.options
[document.nav.link.selectedIndex].value; "value="GO">
<option selected>-CONTACT US-</option>
<option value="mailto:sales@sentrymetering.com">Sales</option>
</select>
KAm
HalloweenFreak
07-23-2002, 01:37 AM
Hi,
This looks like javascripting to me so you might get better answers if you post it in that forum but... It looks to me like something isn't right with "value="GO". It just seems funny looking at it like it is missing a " or one too many. I believe you need to close the first one before these double quotes also.
Hope this helps somehow,
Bye,
Allan
SYP}{ER
07-23-2002, 02:06 AM
The <select> tag doesn't have a "value" attribute that I know of. It's reserved for the <option> tags that are supposed to follow. Not only that, but you're referring to "document.nav.link" your select box is named "select". The code below should work.
<form name="nav">
<select name="link" onchange="window.location=document.nav.link.options
[document.nav.link.selectedIndex].value;">
<option value="" selected="selected">-CONTACT US-</option>
<option value="mailto:sales@sentrymetering.com">Sales</option>
</select>
</form>
kam31uf
07-23-2002, 02:20 AM
Thank you.
Of course now it doenst seem to work in Netscape
justame
07-23-2002, 02:35 AM
kam...
are you just a trying® to have the form 'emaled' to the 'selected' person from the just a dropdown® list??? ifin' thattts the case??? thennn you can just a try® this one posted before by jyoung...:O)))
<SCRIPT LANGUAGE="JavaScript">
function DoMail()
{
var number = document.DropEmail.SelEmail.selectedIndex;
document.DropEmail.action="mailto:"+document.DropEmail.SelEmail[number].value+"?subject=test
"
}
</SCRIPT>
<FORM NAME="DropEmail" METHOD="post" ACTION=" " ENCTYPE="text/plain" onSubmit="return
DoMail()">
<BR><BR><BR><BR>
<TEXTAREA NAME="txta" ROWS="4" COLS="30" WRAP="hard"></TEXTAREA>
<BR><BR>
<SELECT NAME="SelEmail">
<OPTION SELECTED>Select One
<OPTION VALUE="email@me.com">First Email</OPTION>
<OPTION VALUE="mail@me.com">Second Email</OPTION>
</SELECT>
<BR>
<INPUT TYPE="submit"> <INPUT TYPE="reset">
</FORM>
just a goodluck® :O))) n' hoping it helps...:O)))
kam31uf
07-23-2002, 08:30 PM
Ok here is how I am doing all the other drop down menus. This si working nicely. I have tried a couple of the above suggestions and I must be doing something wrong. SYP}{ER 's suggestion worked in a new page but not in the current form I was using.
So is there any way to modify this code to be able to email someone in the drop down?
sorry this is seemingly redundant
<form>
<select onChange="if(options[selectedIndex].value)
window.location.href=(options[selectedIndex].value)">
<option SELECTED>-COMPANY-
<option value="http://www.sentrymetering.com/history.html">Our History
<option value="http://www.sentrymetering.com/bios.html">Bios
<option value="http://www.sentrymetering.com/territories.html">Territories
</option>
</select>
</form>
kam31uf
07-24-2002, 09:21 PM
It has been figured out with a little help from a friend how to accomplish what i was trying to do. I thought others might be interested.
<form name="email">
<select name="select" onChange="location=document.email.select.options[document.email.select.selectedIndex].value;">
<option selected>- CONTACT US -</option>
<option value="mailto:sales@email.com">Sales</option>
<option value="mailto:info@email.com">Info</option>
<option value="mailto:support@email.com">Tech Support</option>
</select>
</form>
Kam
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.