Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disabled text input field posts blank on submit - Why? 1

Status
Not open for further replies.

casabella

Programmer
Aug 30, 2007
59
US
I just came across this. I am intending to have a few fields that may or may not be editable. I use <input ... disabled> when applicable to keep users from editing the content. The problem is that when the form is submitted, the disabled fields are blank.

What is up with that?

Am I using the wrong property?

Thanks,


Jose
 
Expected behaviour... You could use a corresponding hidden field instead to carry over the 'real' data. (In possibly similar circumstances, I've simply shown the data as text rather than as a form field.)
 
I learned that the hard way. My problem is that my fields change from 'closed' to 'opened' based on fields selection throughout the form.

Regards,


Jose
 
Try adding the Readonly attribute to the tex field.

<input type=text readonly=true;>

Although I'm not sure how cross browser compliant the attribute is.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Ignore the semicolon sorry. just readonly or readonly=true should work.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top