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

Help needed with drop down list, adding pop up if wrong thing is click

Status
Not open for further replies.

yoda1979

Programmer
Jun 8, 2003
3
US
hey guys

need some help here, i have a list say this for example.

<head>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
</script>
</head>

<body>
<form name=&quot;form&quot;>
<select name=&quot;site&quot; size=1 onChange=&quot;javascript:formHandler()&quot;>
<option value=&quot;&quot; >Go to....
<option value=&quot;<option value=&quot;<option value=&quot;<option value=&quot;<option value=&quot;<option value=&quot; Source
</select>
</form>
</body>

=================================
what i need is for the go to... (after first option value)and line space right underneath it, instead of doing nothing i would like a pop-up to popup and say choose something please. let them hit ok and they choose again...
any help would be appreciated.

thx,
yoda
 
i'm not completely sure on this, but maybe you could say in the <select> tag onSelect=&quot;javascript: formhandler();&quot;
and add a line in the function....
if (document.form.site.value==null){
alert(&quot;Choose something please&quot;)}


Later,
Greelmo
 
thx Greelmo,

i messed around after i saw what you wrote and got it to work.

late,
yoda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top