954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Disable/Lock Text Input Form Fields

I've created a admin center, that has two seperate login permissions. Admin which can edit listings, etc... and Viewer which can only view listings, and edit 1 or 2 of the listings details and not all of them like the admin.

I've seen web-sites where certain text input fields are sort of Grayed out, not allowing for user to type, click in or change anything in that field. Sort of like the html text input field has been or is disabled...

My Question: How can I get certain html text input fields to appear disabled, and the text that's inside un-editable or unchange-able?

Thank you much

LOVE4CODE
Newbie Poster
1 post since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

> How can I get certain html text input fields to appear disabled, and the text that's inside
> un-editable or unchange-able?
You have got to realize that 'disabled' doesn't mean or equate to 'readonly'. Both these properties disallow the user from editing the entered text but the real difference comes when you try retrieving the form element values at the server. If the element is marked with the property 'disabled', the form element value won't be submitted to the server while a form elements' value marked 'readonly' will be.

<input type="text" name="txtName" id="txtName" readonly="readonly" /> <input type="text" name="txtName" id="txtName" disabled="disabled" />

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

Thank you ~s.o.s~

Zion_Lion
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 1
 

> How can I get certain html text input fields to appear disabled, and the text that's inside > un-editable or unchange-able? You have got to realize that 'disabled' doesn't mean or equate to 'readonly'. Both these properties disallow the user from editing the entered text but the real difference comes when you try retrieving the form element values at the server. If the element is marked with the property 'disabled', the form element value won't be submitted to the server while a form elements' value marked 'readonly' will be.

<input type="text" name="txtName" id="txtName" readonly="readonly" /> <input type="text" name="txtName" id="txtName" disabled="disabled" />


Thanks you very much...im newbies in web programming...God bless

benjiei
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You