By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

DISABLED on HTML forms problem

P: n/a
Perhaps I am reading it wrong, but I assumed that the line below would
cause the value of 1 to be sent to the form. Instead it's sending a
0.

<input type="checkbox" name="email_00_notify" value="1" CHECKED
DISABLED>

So does that mena I am misreading it all and I need to not just CHECK
IT and DISABLE IT, but also include a hidden input element with a
1 ?????
Jan 13 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
SergioQ wrote:
Perhaps I am reading it wrong, but I assumed that the line below would
cause the value of 1 to be sent to the form. Instead it's sending a
0.

<input type="checkbox" name="email_00_notify" value="1" CHECKED
DISABLED>
Since the control is disabled, it won't be successful. It shouldn't be
sending any value at all.
So does that mena I am misreading it all and I need to not just CHECK
IT and DISABLE IT, but also include a hidden input element with a
1 ?????
If you want the value 1 to be sent, then you should not disable the control.

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Jan 13 '08 #2

P: n/a
Scripsit David Dorward:
><input type="checkbox" name="email_00_notify" value="1" CHECKED
DISABLED>

Since the control is disabled, it won't be successful. It shouldn't be
sending any value at all.
And it probably doesn't. I'd guess that the form handler uses the value
of a field named "email_00_notify" without checking its existence, and
in the programming language used, a nonexistent value evaluates to 0 in
some contexts at least.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jan 13 '08 #3

P: n/a
In our last episode,
<c1**********************************@m34g2000hsf. googlegroups.com>, the
lovely and talented SergioQ broadcast on
comp.infosystems.www.authoring.html:
Perhaps I am reading it wrong, but I assumed that the line below would
cause the value of 1 to be sent to the form. Instead it's sending a
0.
><input type="checkbox" name="email_00_notify" value="1" CHECKED
DISABLED>
A disabled control sends nothing at all. It is not sending a 0, but there
are plenty of ways that an undefined value might get interpreted as 0
depending on your handler. At any rate, the disabled control can never send
a 1 (or anything else). Disabled controls are little more than decoration;
they might be used to convey some kind of useful information to the user,
perhaps just a sense of continuity or orientation. But to POST or GET they
might as well be scrollwork.
So does that mena I am misreading it all and I need to not just CHECK
IT and DISABLE IT, but also include a hidden input element with a
1 ?????
You do not need the disabled control at all. If it is disabled, it doesn't
matter whehter it is checked or not. If you want the value to be sent, you
mnst set it in a control that is not disabled, and you can do that in a
hidden control.
--
Lars Eighner <http://larseighner.com/us****@larseighner.com
Countdown: 372 days to go.
Jan 14 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.