PDA

View Full Version : How to disable textfield?


Coral_Lover
10-02-2002, 09:26 AM
Hi, how can i disable a HTML textfield?? Is it using MyForm.TextField.readonly = true???

glenngv
10-02-2002, 09:32 AM
do you mean disabled or readonly?

disable:
document.MyForm.TextField.disabled = true;

readonly:
document.MyForm.TextField.readOnly= true;

Coral_Lover
10-02-2002, 09:38 AM
Hmm.. that's strange, i've tried document.form.text.readonly = true | false liao, but it doesn't work....
In the <INPUT> tag, i've something like this <INPUT NAME = "Text" READONLY>

Coral_Lover
10-02-2002, 09:44 AM
Alrite, thanks Glenn! Though READONLY doesn't work, thank goodness, DISABLED works! Thank u!;)

glenngv
10-02-2002, 09:46 AM
document.MyForm.TextField.readOnly= true;

Coral_Lover
10-02-2002, 09:48 AM
Oic... ARRGHH! Thanks! I'll be more careful next time.:o