Note that there are some explanatory texts on larger screens.

plurals
  1. POonchange not working jquery.selectbox
    text
    copied!<p>In onchange event is not working in jquery.selectbox-05, i am using two dropdown box one for country another one state if i select the country the state will pickup automatically it's work in normal php dropdown but i use this code in jquery.selectbox it's not working anybody will help me</p> <p>Here my code</p> <pre><code>&lt;script type="text/javascript" src="scripts/jquery.selectbox-0.5.js"&gt;&lt;/script&gt; &lt;script type= "text/javascript" src = "scripts/countries2.js"&gt;&lt;/script&gt; $(document).ready(function(){ $('.selectBoxMedium').selectboxMedium(); $('.selectBoxSmall').selectboxSmall(); $('.selectBoxSmallest').selectboxSmallest(); $('.selectBox').selectbox(); $(document).pngFix(); }); &lt;p class="formInput formSelectBox"&gt; &lt;select onchange="print_state1('state',this.selectedIndex);" id="country" class= "selectBox data" name ="country"&gt;&lt;/select&gt; &lt;/p&gt; &lt;p class="formInput formSelectBox"&gt; &lt;select name ="state" id ="state" class="selectBox"&gt;&lt;/select&gt; &lt;script language="javascript"&gt;print_country1("country");&lt;/script&gt; &lt;/p&gt; </code></pre> <p>Javascript functions:</p> <pre><code>function print_country1(country_id) { // given the id of the &lt;select&gt; tag as function argument, it inserts &lt;option&gt; tags var option_str = document.getElementById(country_id); var x, i=0; for(x in country_arr){ option_str.options[i++] = new Option(country_arr[x],country_arr[x]); } } function print_state1(state_id, state_index) { var option_str = document.getElementById(state_id); var x, i=0; state_index++; var state_arr = s_a[state_index].split("|"); for(x in state_arr) { option_str.options[i++] = new Option(state_arr[x],state_arr[x]); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload