Click here to get back home

DISABLED on HTML forms problem

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DISABLED on HTML forms problem SergioQ 01-13-2008
Posted by SergioQ on January 13, 2008, 12:39 pm
Please log in for more thread options
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 ?????

Posted by David Dorward on January 13, 2008, 2:21 pm
Please log in for more thread options
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/

Posted by Jukka K. Korpela on January 13, 2008, 2:57 pm
Please log in for more thread options
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/


Posted by Lars Eighner on January 13, 2008, 7:08 pm
Please log in for more thread options
In our last episode,
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/> usenet@larseighner.com
Countdown: 372 days to go.

Similar ThreadsPosted
Problem with forms - user uploaded files being overwrtten June 22, 2005, 3:11 pm
Forms - howto use return for submitting in Forms? April 6, 2005, 4:08 pm
HTML Forms basics March 11, 2005, 3:22 am
html forms question February 1, 2006, 6:08 pm
HTML Forms, file input. How extensible is it? October 19, 2005, 2:12 am
'sorry this function has been disabled' February 5, 2008, 10:09 am
with disabled attribute October 12, 2004, 11:47 am
Forecolor of disabled controls February 15, 2007, 9:47 pm
grey-out/disabled item in listbox March 10, 2006, 11:22 pm
Swap images if Javascript is disabled June 27, 2006, 4:59 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap