Page 1 of 1

not editable text field

Posted: Fri Sep 23, 2005 4:46 pm
by rajan
how to make text field not editable

Posted: Fri Sep 23, 2005 5:00 pm
by qads
you can use disabled

Code: Select all

<input type="text" name="field" value="blaa" disabled>

JS too

Code: Select all

document.forms[0].address.disabled = true;

Posted: Sat Sep 24, 2005 1:56 am
by n00b Saibot
qads wrote:you can use disabled
FYI, disabled stops the value from being submitted
instead, you can use readonly

Code: Select all

<input type="text" name="field" value="blaa" readonly=readonly />
same for JS :arrow: readOnly