title: jQuery get / set value of textbox value in a repeater
body: <p>I have a repeater with textboxes ID="txtBomName" in an ascx page with a value retrieved from datatable on pageload. 
  the end user can change the value, must be not be null/empty. 
  I have jquery to check if null/empty on change or blur, produce alert if null then I would like the null value set back to original else set value as user entered.
  This does work if, I use the generated control ID i.e: </p>
  
  <pre><code>$("#p_lt_ctl02_pageplaceholder_p_lt_zoneMainContent1_BOM_rptBoms_ctl00_txtBomName)"
  </code></pre>
  
  <p>this obviously only works for the the first textbox on the page, as the "ct100" part of the ID changes for each box. 
  code: </p>
  
  <pre><code>   $(document).ready(function () {
      $("#p_lt_ctl02_pageplaceholder_p_lt_zoneMainContent1_BOM_rptBoms_ctl00_txtBomName").change(function () {
          var oldVal = this.getAttribute('value');
          if (this.value == null || this.value == "") {
              alert("Please ensure the name is not empty");
              $("#p_lt_ctl02_pageplaceholder_p_lt_zoneMainContent1_BOM_rptBoms_ctl00_txtBomName").val(oldVal);
          }
          else {
              $("#p_lt_ctl02_pageplaceholder_p_lt_zoneMainContent1_BOM_rptBoms_ctl00_txtBomName").val(this.value);
          }
      });
      });
  </code></pre>
  
  <p>so, I changed the code to look for <strong>id$=txtBomName</strong> and set an alert to (this.id) the id for each box shows correctly, how can I set the value of the textboxes using <strong>(this.id).val(oldVal);</strong> ? </p>