I've noticed something, at least I *think* i have...
I have a form for editing a user profile, and it shows the user their user ID number in a text box that is disabled so they cannot change it. I assumed this value would be passed when the form is submitted, but apparently it is not. Is the only way to get around this to use a hidden field?
HTML forms - disabled text fields not supposed to pass value
Moderator: General Moderators
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
I haven't noticed it until now! Thanks 
Well you will have to do something like this:
Cheers,
Scorphus.
Well you will have to do something like this:
Code: Select all
<input type="text" name="email" value="me@myhost.com" disabled="true" /><br />
<input type="hidden" name="email" value="me@myhost.com" /><br />Scorphus.
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
I think it makes that sense too. Mozilla also doesn't pass a disabled field, but Opera (6.05) doesmaniac9 wrote:yeah, that works fine - i guess it makes some sense not to pass a field that is disabled, but it interesting now that this is actually the case, at lease with IE5
here's a better fix: use the readonly attribute insteadtry that in your test. tell me if it passes and if it's changable. i think you'll find that unlike the disable which is meant to NOT PASS a value, that this is meant to pass the value one sees
i know from expereince that netscape 7.0, M$IE 5+ and mozilla 1.3.1+ don't pass. i haven't tried on netscape 4.xx but i don't care cuz that wont woork with my site and i make sure ppl know.
fyi: my work around is to set it myself, but then again, on all the instances i use that i know exactly what i want it to be. in the past when i've wanted to block user manipulation i've always used the readonly attribute that has been around since html 3.0
Code: Select all
<input type="text" name="email" value="joe.shmoe@whatever.com" readonly>i know from expereince that netscape 7.0, M$IE 5+ and mozilla 1.3.1+ don't pass. i haven't tried on netscape 4.xx but i don't care cuz that wont woork with my site and i make sure ppl know.
fyi: my work around is to set it myself, but then again, on all the instances i use that i know exactly what i want it to be. in the past when i've wanted to block user manipulation i've always used the readonly attribute that has been around since html 3.0
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
• Opera (6.05) pass the disabled and readonly fileds. There is no how change them.
• M$IE, Mozilla, Firebird, Nautilus, Galeon, Konkeror and Lynx pass only the readonly field. There is no how change the disabled and readonly fields.
• Lynx (2.8.4rel.1) lets you change the readonly filed
!
Cheers,
Scorphus.
• M$IE, Mozilla, Firebird, Nautilus, Galeon, Konkeror and Lynx pass only the readonly field. There is no how change the disabled and readonly fields.
• Lynx (2.8.4rel.1) lets you change the readonly filed
Cheers,
Scorphus.