Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would start by changing the ID field you have to use seperate names, currently the only byID field you'll get with "pledge" is the selector element</p> <pre><code>&lt;form name="form1"&gt; &lt;!-- SELECT WORKS --&gt; &lt;select size=1 name="pledge" id="pledge" onchange="NewVal(c_iitem.pledge);" onkeyup="NewVal(c_iitem.pledge);"&gt; &lt;option value="-1" selected&gt; &lt;/option&gt; &lt;option value="0"&gt;pledgeA&lt;/option&gt; &lt;option value="1"&gt;pledgeB&lt;/option&gt; &lt;option value="2"&gt;pledgeC&lt;/option&gt; &lt;option value="3"&gt;pledgeD&lt;/option&gt; &lt;/select&gt; &lt;hr /&gt; &lt;!-- RADIO DOES NOT --&gt; &lt;input type="radio" name="pledge" id="pledge" value="-l" style="display:none" checked&gt; &lt;input name="pledge" id="pledge" type="radio" value="0" onchange="NewVal(c_iitem.pledge);" onkeyup="NewVal(c_iitem.pledge);"&gt;Pledge A&lt;br/&gt; &lt;input name="pledge" id="pledge2" type="radio" value="1" onchange="NewVal(c_iitem.pledge);" onkeyup="NewVal(c_iitem.pledge);"&gt;Pledge B&lt;br/&gt; &lt;input name="pledge" id="pledge3" type="radio" value="2" onchange="NewVal(c_iitem.pledge);" onkeyup="NewVal(c_iitem.pledge);"&gt;Pledge C&lt;br/&gt; &lt;input name="pledge" id="pledge" type="radio" value="3" onchange="NewVal(c_iitem.pledge);" onkeyup="NewVal(c_iitem.pledge);"&gt;Pledge D&lt;br/&gt; &lt;hr /&gt; &lt;input id="shipping_us" type="radio" name="shipping" value="-1" checked onchange="NewVal(c_iitem.shipping);" onkeyup="NewVal(c_iitem.shipping);"&gt;No Shipping&lt;br/&gt; &lt;input id="shipping" type="radio" name="shipping" value="0" onchange="NewVal(c_iitem.shipping);" onkeyup="NewVal(c_iitem.shipping);"&gt;Shipping &lt;hr /&gt; Pledge $&lt;span id="pledgeAmt"&gt;0&lt;/span&gt; &lt;hr /&gt; Shipping $&lt;span id="shipAmt"&gt;0&lt;/span&gt; &lt;hr /&gt; Total $&lt;span id="total"&gt;0&lt;/span&gt; &lt;/form&gt; </code></pre> <p>2 of your radio buttons use the "pledge" id as well</p> <p>EDIT: One way to select the object that an event happened on is to select by class and then use the $(this) jquery selector</p> <pre><code>$(".clickMe").click(function(){ $(this).css("background-color", "red"); }); </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