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

Combo box - OnChange event

Status
Not open for further replies.

eyal

Programmer
May 15, 2000
38
IL
Hi,<br>Can someone please tell me the syntax of OnChange Combo box event?<br>Thanks<br>Eyal
 
Dear eyal,<br><br>&lt;select name=&quot;x&quot; id=&quot;x&quot; onchange=&quot;myOnChange()&quot;&gt;<br>&lt;option value=&quot;1&quot;&gt;Item one&lt;/option&gt;<br>&lt;option value=&quot;2&quot;&gt;Item two&lt;/option&gt;<br>&lt;option value=&quot;3&quot;&gt;Item three&lt;/option&gt;<br>&lt;/select&gt;<br>&lt;script language=javascript&gt;<br>&lt;!--<br>function myOnChange(){<br>&nbsp;&nbsp;alert(&quot;in myOnChange()&quot;);<br>&nbsp;&nbsp;// don't know what you want to do here!<br>}<br>--&gt;<br>&lt;/script&gt;<br><br>Hope this helps<br>-pete
 
Sorry for not mentioning it at the begining, is it possible to do it in VBScript?
 
All you need to do is create the function myOnChange in VBScript instead.<br><br>&lt;script language=vbscript&gt;<br>Private Function myOnChange(InValue)<br>&nbsp;'Blah de blah<br>End Function<br>&lt;/script&gt;<br><br>Remember though, VBScript is really for Server Side scripting.<br><br>I'd recommend getting something like 'Javascript Bible' for a good all round book on Javascript. MSDN information can be found at: <br><br><A HREF=" TARGET="_new"> <p>Ben Marshalsea<br><a href=mailto: > </a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top