User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,154 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,159 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 7514 | Replies: 1
Reply
Join Date: Sep 2007
Posts: 1
Reputation: LOVE4CODE is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
LOVE4CODE LOVE4CODE is offline Offline
Newbie Poster

Disable/Lock Text Input Form Fields

  #1  
Sep 29th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,767
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 329
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Disable/Lock Text Input Form Fields

  #2  
Sep 29th, 2007
> 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" />
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 7:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC