Home Javascript How to disable and enable HTML form fields using JavaScript?
 
 
 

How to disable and enable HTML form fields using JavaScript?

PDF Print E-mail

Question: How to disable and enable HTML form fields using JavaScript?

 

Answer:

To enable a form field use the below JavaScript

document.getElementById("ELEMENT_ID").disabled = false;

And to disable the form field use the below JavaScript

document.getElementById("ELEMENT_ID").disabled = true;

NOTE: Replace ELEMENT_ID with the form fields ID


+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!