Discussions

Expand all | Collapse all

How to change read-only form field from code?

  • 1.  How to change read-only form field from code?

     
    Posted 04-20-2018 19:54
    I have a form with a lot of signature fields.  Basically the user checks a box and it populates a field with their name and date/time stamp as an electronic signature.  The signature field is read-only on the form, and a rule is in place for each to act when the checkbox is changed.  Works, great, except I want to reduce the number of rules and use them for other purposes.  So, I added the IOL technique, which works if the signature field is not set to read-only.  Is there a way to change a read-only form field from the IOL Javascript?   Thanks!


  • 2.  RE: How to change read-only form field from code?

     
    Posted 04-23-2018 20:19
    Just a little more info on this.  Field #26 is the checkbox, and #17 is a text field to hold the signature.  Here's a piece of the code:

      // Project Manager Signature
      $("#_fid_26").change(function() {
        if($("#_fid_26").is(":checked")) {
         $("#_fid_17").val("Signature Text");
        }else{
         $("#_fid_17").val("");
        }
      });   

    As long as the signature field (#17) is not set to read only, it works fine.  When set to read-only it doesn't work.