|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Unchangable Form input box
How would I make a input field uneditable so the value inside is grayed out?
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#2
|
|||
|
|||
|
<input ... disabled> makes it greyed out and not selectable, but I think it also does not pass a value on submission either.
<input ... readonly> does pass the value, which cannot be changed (by hand). Note neither of these attributes work in Netscape 4 and older browsers and neither are secure from hacking/tampering in IE ad likely other browsers. |
|
#3
|
|||
|
|||
|
In case you just want to show something to people, you better not process and insert the data from the "disabled" input-field.. I'm sure you already thought of that, though..
![]()
__________________
Best Regards, Håvard Lindset |
|
#4
|
|||
|
|||
|
Why just use a regular cell and output the data to that cell:
<td>$data</td> This way it's displayed, but it cannot be edited by the user.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#5
|
|||
|
|||
|
of course that way is the standard/common way to display information that you don't want edited or updated in your database, but the original mquestion didn't state what it was for...
If that is the intention, then just displaying the text is a much more secure way of showing the information and making it non-editable. On the other hand, if there is a need to dynamically toggle the disabled or read-only attribute based on some other form conditions, it's easier to use a form field from the start. |
|
#6
|
|||
|
|||
|
yup, thanks guys. got it working. I could just do it the conventional way and just make it print, however I feel putting it in a form box makes it look cooler, in my opinion.
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Unchangable Form input box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|