Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Correctly said by Moazzam Khan, there is a syntax alert as well as no of parameter :</p> <p>select.addEventListener('change', function(){ updatePrice(document.getElementById('orderType'), document.getElementsByName('stopprice')[0], document.getElementsByName('limitprice')[0], stopPrices); },false);</p> <p>Use the following script code:</p> <pre><code>&lt;script&gt; function updatePrice (el, priceLog, priceLog1, priceList) { try{ var e = document.getElementById("orderType"); var pricevalue = e.options[e.selectedIndex].text; if(pricevalue.toLowerCase() == "market"){ priceLog.value = priceList[el.getElementsByTagName('option')[el.selectedIndex].value.toLowerCase()]; priceLog1.value = priceList[el.getElementsByTagName('option')[el.selectedIndex].value.toLowerCase()]; } else if(pricevalue.toLowerCase() == "limit"){ document.getElementByName('limitprice').readOnly = false; priceLog.value = priceList[el.getElementsByTagName('option')[el.selectedIndex].value.toLowerCase()]; priceLog1.value =priceList[el.getElementsByTagName('option')[el.selectedIndex].value.toLowerCase()]; } else if(pricevalue.toLowerCase() == "stop"){ document.getElementByName('stopprice').readOnly = false; priceLog.value = priceList[el.getElementsByTagName('option')[el.selectedIndex].value.toLowerCase()]; priceLog1.value = priceList[el.getElementsByTagName('option')[el.selectedIndex].value.toLowerCase()]; } } catch(err) { } } var stopPrices = { 'market' : 0, 'limit' : 1, 'stop' : 2, }; var limitPrices={ 'market' : 0, 'limit' : 1, 'stop' : 2, }; var select = document.getElementById('orderType'), hidden = document.getElementsByName('stopprice')[0]; hidden1= document.getElementsByName('limitprice')[0]; select.addEventListener('change', function(){ updatePrice(document.getElementById('orderType'), document.getElementsByName('stopprice')[0], document.getElementsByName('limitprice')[0], stopPrices); },false); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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