disable fields

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

disable fields

Post by s.dot »

I want my entire form to be disabled.

This will be used simply to show a user what they filled out. I don't want them to be able to edit it or anything. So how do I go about disabling a form?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
J_Iceman05
Forum Commoner
Posts: 72
Joined: Wed Aug 03, 2005 10:52 am
Location: Las Vegas, NV

2 ways

Post by J_Iceman05 »

I am not sure if there is a way to disable the entire form in just 1 line of code, or maybe even 2.
but within each input tag you can add ' readyonly ' or ' disabled="true" '

Example:

Code: Select all

<input type="text" name="name" value="<php echo $_POST['name']?>" disabled="true">
or
<input type="text" name="name" value="<php echo $_POST['name']?>" readonly>
the only difference i can see between the 2 ways, is that in IE "disabled" greys out the box and "readonly" does not

hope that answers your question fully
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

That works beautifully. Thanks.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply