Why did this method stop firing?
I have this method:
- /* This causes the textbox to grow dynamically (vertically) as text/rows (lines) are added */
- $("[id$=explainPaymentTextBox]").keyup(function (e) {
- while ($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
- $(this).height($(this).height() + 1);
- };
- });
...which was working fine (causes the textbox to grow vertically as necessary so that all text entered is visible), but all of a sudden, with no change of code, stopped working. Just to be sure it was firing, I added an alert:
- /* This causes the textbox to grow dynamically (vertically) as text/rows (lines) are added */
- $("[id$=explainPaymentTextBox]").keyup(function (e) {
- alert("explainPaymentTextBox keyup reached");
- while ($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
- $(this).height($(this).height() + 1);
- };
- });
And I don't see the alert! Why would the function all of a sudden stop firing and, more importanlty, how can I get it to fire again?
There *is* an element with that ID; here's an excerpt from "View Source":
-
<span class="finaff-webform-field-label" style="display:inline-block;">Explain Payment: </span><textarea name="ctl00$ctl24$g_5f3fedca_19f7_4bc3_b84e_efbef0c48a33$ctl00$explainPaymentTextBox" rows="2" cols="20" id="ctl00_ctl24_g_5f3fedca_19f7_4bc3_b84e_efbef0c48a33_ctl00_explainPaymentTextBox" class="finaff-webform-field-input" style="width:660px;display:inline-block;"></textarea><br></br><span class="finaff-webform-field-label"><h2>FOAPAL / Payment Amount Information</h2></span><br></br><button id="ctl00_ctl24_g_5f3fedca_19f7_4bc3_b84e_efbef0c48a33_ctl00_btnAddFoapalRow" type="button" OnClientClick="return false;">+</button><table border="2">