not editable text field

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

not editable text field

Post by rajan »

how to make text field not editable
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post 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;
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post 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
Post Reply