Jump to content

running multiple javascripts


DarkPrince2005

Recommended Posts

i've got two javascripts that i'd like to run in a drop down boxes onChange event, can this be done?

 

<select onchange="javascript:window.location=this.value; setOptions()">
					<option>- Select -</option>
					<option value="form.html">Form</option>
					<option value="form1.html">Form1</option>
					<option value="form2.html">Form2</option>
					<option value="form3.html">Form3</option>
					<option value="form4.html">Form4</option>
					</select>

Link to comment
https://forums.phpfreaks.com/topic/97515-running-multiple-javascripts/
Share on other sites

You're redirecting user and calling the setOptions function at the same time. The setOptions function will never run as javascript will redirect the user before it gets to call the setOptions funcion.

 

I'd say add redirection code at the end of the setOptions function.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.