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?

Alan Wells
  • 27,268
  • 14
  • 81
  • 128
D. Lin
  • 1

1 Answers1

1

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

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

OR:

$('#company-name').attr('disabled', true);
Alan Wells
  • 27,268
  • 14
  • 81
  • 128