Basically i want a disable text field to show the value stored in a database but i don't want it to be editable by the user.
i've tried using disabled="disabled"
but then it no longer POST to my form handler...
Any suggestions?
thanks
Basically i want a disable text field to show the value stored in a database but i don't want it to be editable by the user.
i've tried using disabled="disabled"
but then it no longer POST to my form handler...
Any suggestions?
thanks
docu:
In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form.
why do you need the value? then try the readonly
-attribute instead of disabled
or go for another hiddenfield.
edit:
it's not fully clear to me, if you use asp.net, bu if so, you could just do
<form submitdisabledcontrols="true" runat="server">
you may give it a try :)
If you insist on using a disabled field, you can enable it during form submission by handling the form onsubmit
event, where you will enable the field and submit the form.
A second option would be to use a readonly
field which you may cleverly make look as disabled
via CSS.
A third option would be to use a disabled
and a hidden
field. Rename your disabled
field to something irrelevant and use the original field's name for the hidden one.
Take your pick.