Disabling all fields in the form using method

How can i disable all fields on a form and enable only one using code, without putting all field names in the code except one which is to be disabled.

  • Hi Hkhan,

    In the Form Editor, you can disable all the fields by default, then enable the one field using a method.  Under the Field Physical tab, check the Disabled checkbox for each field.  Then in the Form Event tab, add an onLoad Method to enable the chosen field.  The code for the Method should look like:

    var input = getFieldByName("field_name");
    input.getElementsByTagName("input")[0].disabled = false;

    Best,

    Kate