| | |
Disable/Lock Text Input Form Fields
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Solved Threads: 0
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
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
> 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.
> 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.
•
•
Join Date: Jul 2009
Posts: 1
Reputation:
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
In GOD we trust!
![]() |
Similar Threads
- Accessing objects that are not in the form fields (JavaScript / DHTML / AJAX)
- Help on clear text in <input> !! (HTML and CSS)
- Text input box alignment question (HTML and CSS)
- Input without a form for DLL (Visual Basic 4 / 5 / 6)
- Form Fields (JavaScript / DHTML / AJAX)
- How do I create own Shout box/or input and display form? (PHP)
- Passing variables into form fields (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Expand function
- Next Thread: need to autofill the textbox using ajax:autocomplete
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug captchaformproblem checkbox close codes createrange() css cursor debugger decimal dependent disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie8 iframe index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem onreadystatechange paypal pdf php player programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c window windowofwords windowsxp wysiwyg \n






