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
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 asdisabled
via CSS.A third option would be to use a
disabled
and ahidden
field. Rename yourdisabled
field to something irrelevant and use the original field's name for the hidden one.Take your pick.
docu:
why do you need the value? then try the
readonly
-attribute instead ofdisabled
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
you may give it a try :)