Javascript function help !

laurentmartin 21 Jun, 2011
Hello,

I am trying to use Javascript to display dynamically a result directly in to the form after having operating reading two dropdown to get parameters and select a result from a table with double entry.

Typically I have two drop down as follow :
DROP DOWN 1:
<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Lot size</label>
    <select class="cf_inputbox validate-selection" id="quantity" size="1" title=""  name="quantity">
    <option value="">Choose Option</option>
      <option value="10 to 100">10 to 100</option>
<option value="100 to 200">100 to 200</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>


DROPDOWN 2

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">inspection level</label>
    <select class="cf_inputbox" id="level" size="1" title=""  name="level">
    <option value="">Choose Option</option>
      <option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>


From the value of those two dropdown, i need to read a table with double entry in javascript that I have declared as follow and whoich give me the result i would like to display:
var table = new Array();
	table[1][1] = 2;
	table[1][2] = 2;
	table[2][1] = 2;
	table[2][2] = 3;


the model is table[x][y] where:
x is the value of the first dropdown
y is the value of the second dropdown
so typically
if "10 to 100" is selected in the first drop down, it should give me x = 1
if "100 to 200" is selected in the first drop down, it should give me x = 2

Does someone can explain to me how to get the value of the dropdown to pass them to javascript ?

Thanks
This topic is locked and no more replies can be posted.