Hi,

I have a HTML that looks something like this:

<form name="form1" method="post" action="">
<select name="name1" id="id1" onchange="someJavaScriptFunction(somearg1,somearg2)">
													<option style="" value="a0">a0</option>
													<option style="" value="a1">a1</option>
													<option style="" value="a2">a2</option>
											</select>
</form>

What i need to do is execute the onchange event outside the form, so i don't have to write it in the <select> tags, but, for example, in the <script> tags.

Thanks for any helpful responses.

<script type="text/javascript">
document.getElementById('id1').onchange=function(){}
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.