Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery keyup event not triggering
    primarykey
    data
    text
    <p>I'm trying to create a keyup event for 3 fields so that when any one of these 3 fields is typed in it triggers a function. I'm working in IE since this is the only browser our application officially supports. This is the important bits of the html It will be using.</p> <pre><code>&lt;input title="Buy Price (Cannot be used in conjunction with Percentage Price)" name="BuyRate" size="3" id="BuyRate" type="text" /&gt; &lt;input title="Sell Price (Cannot be used in conjunction with Percentage Price)" name="SellRate" size="3" id="SellRate" type="text" /&gt; &lt;input title="Percentage Price (Cannot be used in conjunction with Buy/Sell Price)" name="PercentagePrice" id="PercentagePrice" type="text" id="PercentagePrice" maxlength="9" size="5" /&gt; </code></pre> <p>And here is the JQuery I currently have.</p> <pre><code>$("#BuyRate").keyup(function() { alert("1"); checkBuySellPercentage(); }); $("#SellRate").keyup(function() { alert("2"); checkBuySellPercentage(); }); $("#PercentagePrice").keyup(function() { alert("3"); checkBuySellPercentage(); }); function checkBuySellPercentage() { alert("4"); var buyrate = $.trim($("#BuyRate").val()); var sellrate = $.trim($("#SellRate").val()); var percentageprice = $.trim($("#PercentagePrice").val()); if (buyrate !== "" || sellrate !== "") { $("#PercentagePrice").attr("disabled", "disabled"); } else if (percentageprice !== "") { $("#BuyRate").attr("disabled", "disabled"); $("#SellRate").attr("disabled", "disabled"); } else { $("#BuyRate").removeAttr("disabled"); $("#SellRate").removeAttr("disabled"); $("#PercentagePrice").removeAttr("disabled"); } } </code></pre> <p>Why isn't this working correctly?</p>
    singulars
    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.
 

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