0

I'm a new user to Google App Script and I'm trying to disable a text input using Google App Script in the HTML file. I've tried:

      $('#company-name').attr('enabled', false);

and I've also tried

      $('#company-name').enabled = false;

This is within a script section on the HTML page. The function with these lines of code is called when prepopulating a form. However, the text box can still be edited after the form is prepopulated.

How do I edit form element attributes and disable a text box or other input?

1
  • 3
    This is not an Apps Script question. It's an HTML question.
    – Alan Wells
    Mar 20, 2017 at 21:44

1 Answer 1

1

There is no "enabled" attribute. There is only a disabled attribute:

$("input").attr('disabled','disabled');

OR:

$('#company-name').attr('disabled', true);

Not the answer you're looking for? Browse other questions tagged or ask your own question.