Via JavaScript within the client page containing the checkbox, I'm trying to capture the value of a
checkbox to make a cookie out of it. But, all I get is the defined "ON" value, even when it is
unchecked. I'm using the following construct:
document.cookie = "cpceRememberLoginCookie="+document.getPage1.remem berLogin.value+"; expires=Thr,
01-Jan-2015 00:00:00 GMT";
The actual checkbox value passed in the <form> POST reflects the actual state of the checkbox.
Thanks for your help.
Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- 7 2902
Don wrote: Via JavaScript within the client page containing the checkbox, I'm
trying to capture the value of a checkbox to make a cookie out of it. But, all I get is the defined
"ON" value, even when it is unchecked. I'm using the following construct:
document.cookie =
"cpceRememberLoginCookie="+document.getPage1.remem berLogin.value+";
expires=Thr, 01-Jan-2015 00:00:00 GMT";
The actual checkbox value passed in the <form> POST reflects the
actual state of the checkbox. Thanks for your help. Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News
==---------- http://www.newsfeed.com The #1 Newsgroup Service in the
World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19
Servers =-----
A checkbox functions within an HTML form by submitting the usual
*name=value* pair when checked, and *nothing* when not. All reading the
Checkbox.value property programmatically will get you is - the checkbox
value. ;) The default is "on" btw. You want the .checked property, a
Boolean. The concatenation will type-convert it to 'true' / 'false'.
Hope I understood your Q.
On 20 Dec 2004 09:06:14 -0800, "RobB" <fe******@hotmail.com> wrote: Don wrote: Via JavaScript within the client page containing the checkbox, I'm trying to capture the value of a checkbox to make a cookie out of it. But, all I get is the defined "ON" value, even when it is unchecked. I'm using the following construct:
document.cookie = "cpceRememberLoginCookie="+document.getPage1.reme mberLogin.value+"; expires=Thr, 01-Jan-2015 00:00:00 GMT";
The actual checkbox value passed in the <form> POST reflects the actual state of the checkbox. Thanks for your help. Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News
==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
A checkbox functions within an HTML form by submitting the usual *name=value* pair when checked, and *nothing* when not. All reading the Checkbox.value property programmatically will get you is - the checkbox value. ;) The default is "on" btw. You want the .checked property, a Boolean. The concatenation will type-convert it to 'true' / 'false'. Hope I understood your Q.
Thanks for your reply Rob. I think I understand what you're saying. What is the JS code to
reference the checked property (boolean)?
Thanks,
Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
Don wrote: On 20 Dec 2004 09:06:14 -0800, "RobB" <fe******@hotmail.com> wrote:
Don wrote: Via JavaScript within the client page containing the checkbox, I'mtrying to capture the value of a checkbox to make a cookie out of it. But, all I get is the
defined"ON" value, even when it is unchecked. I'm using the following construct:
document.cookie = "cpceRememberLoginCookie="+document.getPage1.reme mberLogin.value+"; expires=Thr, 01-Jan-2015 00:00:00 GMT";
The actual checkbox value passed in the <form> POST reflects the actual state of the checkbox. Thanks for your help. Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News
==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
A checkbox functions within an HTML form by submitting the usual *name=value* pair when checked, and *nothing* when not. All reading
theCheckbox.value property programmatically will get you is - the
checkboxvalue. ;) The default is "on" btw. You want the .checked property, a Boolean. The concatenation will type-convert it to 'true' / 'false'. Hope I understood your Q. Thanks for your reply Rob. I think I understand what you're saying.
What is the JS code to reference the checked property (boolean)?
Thanks, Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News
==---------- http://www.newsfeed.com The #1 Newsgroup Service in the
World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19
Servers =-----
Assuming there's only one element of that name, same as you're using -
with the substitution of 'checked' for 'value'. Or: give the cb an
id="foo" (or whatever) and use document.getElementById("foo").
If you want the actual value if checked, and nothing (empty string) if
unchecked, use:
document.cookie =
"cpceRememberLoginCookie=" +
((document.getPage1.rememberLogin.checked) ?
document.getPage1.rememberLogin.value : "") +
"; expires=Thr,01-Jan-2015 00:00:00 GMT" +
"; path=/"; http://www.quirksmode.org/js/cookies.html
On 20 Dec 2004 11:13:08 -0800, "RobB" <fe******@hotmail.com> wrote: Don wrote: On 20 Dec 2004 09:06:14 -0800, "RobB" <fe******@hotmail.com> wrote:
> >Don wrote: >> Via JavaScript within the client page containing the checkbox, I'm >trying to capture the value of a >> checkbox to make a cookie out of it. But, all I get is thedefined >"ON" value, even when it is >> unchecked. I'm using the following construct: >> >> document.cookie = >"cpceRememberLoginCookie="+document.getPage1.reme mberLogin.value+"; >expires=Thr, >> 01-Jan-2015 00:00:00 GMT"; >> >> The actual checkbox value passed in the <form> POST reflects the >actual state of the checkbox. >> >> Thanks for your help. >> Don >> >> >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >==---------- >> http://www.newsfeed.com The #1 Newsgroup Service in the >World! >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 >Servers =----- > >A checkbox functions within an HTML form by submitting the usual >*name=value* pair when checked, and *nothing* when not. All readingthe >Checkbox.value property programmatically will get you is - thecheckbox >value. ;) The default is "on" btw. You want the .checked property, a >Boolean. The concatenation will type-convert it to 'true' / 'false'. >Hope I understood your Q. Thanks for your reply Rob. I think I understand what you're saying. What is the JS code to reference the checked property (boolean)?
Thanks, Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
Assuming there's only one element of that name, same as you're using - with the substitution of 'checked' for 'value'. Or: give the cb an id="foo" (or whatever) and use document.getElementById("foo").
If you want the actual value if checked, and nothing (empty string) if unchecked, use:
document.cookie = "cpceRememberLoginCookie=" + ((document.getPage1.rememberLogin.checked) ? document.getPage1.rememberLogin.value : "") + "; expires=Thr,01-Jan-2015 00:00:00 GMT" + "; path=/";
http://www.quirksmode.org/js/cookies.html
Thanks Rob. However, I'm not sure I understand the use of "?" and ":" in the following:
((document.getPage1.rememberLogin.checked) ? document.getPage1.rememberLogin.value : "").
Could you explain that please.
Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
Don wrote: On 20 Dec 2004 11:13:08 -0800, "RobB" <fe******@hotmail.com> wrote:
Don wrote: On 20 Dec 2004 09:06:14 -0800, "RobB" <fe******@hotmail.com>
wrote: > >Don wrote: >> Via JavaScript within the client page containing the checkbox,
I'm >trying to capture the value of a >> checkbox to make a cookie out of it. But, all I get is thedefined >"ON" value, even when it is >> unchecked. I'm using the following construct: >> >> document.cookie = "cpceRememberLoginCookie="+document.getPage1.reme mberLogin.value+"; >expires=Thr, >> 01-Jan-2015 00:00:00 GMT"; >> >> The actual checkbox value passed in the <form> POST reflects
the >actual state of the checkbox. >> >> Thanks for your help. >> Don >> >> >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >==---------- >> http://www.newsfeed.com The #1 Newsgroup Service in
the >World! >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 >Servers =----- > >A checkbox functions within an HTML form by submitting the usual >*name=value* pair when checked, and *nothing* when not. All
readingthe >Checkbox.value property programmatically will get you is - the checkbox >value. ;) The default is "on" btw. You want the .checked
property, a >Boolean. The concatenation will type-convert it to 'true' /
'false'. >Hope I understood your Q. Thanks for your reply Rob. I think I understand what you're
saying.What is the JS code to reference the checked property (boolean)?
Thanks, Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
Assuming there's only one element of that name, same as you're using
-with the substitution of 'checked' for 'value'. Or: give the cb an id="foo" (or whatever) and use document.getElementById("foo").
If you want the actual value if checked, and nothing (empty string)
ifunchecked, use:
document.cookie = "cpceRememberLoginCookie=" + ((document.getPage1.rememberLogin.checked) ? document.getPage1.rememberLogin.value : "") + "; expires=Thr,01-Jan-2015 00:00:00 GMT" + "; path=/";
http://www.quirksmode.org/js/cookies.html Thanks Rob. However, I'm not sure I understand the use of "?" and
":" in the following: ((document.getPage1.rememberLogin.checked) ?
document.getPage1.rememberLogin.value : ""). Could you explain that please. Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News
==---------- http://www.newsfeed.com The #1 Newsgroup Service in the
World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19
Servers =-----
Conditional operator [ (condition) ? if-true : if-false ]
((document.getPage1.rememberLogin.checked) ? ---> box checked?
document.getPage1.rememberLogin.value ---> yes, get value
: ---> else
"") ---> no, use empty string
Just a more compact form of if-else. Can be cascaded:
(condition) ? if-true : (2nd condition) ? if-true : (3rd condition) ?
if-true : if-false
....something like switch/case. The latter is faster, however.
On 20 Dec 2004 12:23:01 -0800, "RobB" <fe******@hotmail.com> wrote: Don wrote: On 20 Dec 2004 11:13:08 -0800, "RobB" <fe******@hotmail.com> wrote:
> >Don wrote: >> On 20 Dec 2004 09:06:14 -0800, "RobB" <fe******@hotmail.com>wrote: >> >> > >> >Don wrote: >> >> Via JavaScript within the client page containing the checkbox,I'm >> >trying to capture the value of a >> >> checkbox to make a cookie out of it. But, all I get is the >defined >> >"ON" value, even when it is >> >> unchecked. I'm using the following construct: >> >> >> >> document.cookie = >> "cpceRememberLoginCookie="+document.getPage1.rem emberLogin.value+"; >> >expires=Thr, >> >> 01-Jan-2015 00:00:00 GMT"; >> >> >> >> The actual checkbox value passed in the <form> POST reflectsthe >> >actual state of the checkbox. >> >> >> >> Thanks for your help. >> >> Don >> >> >> >> >> >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >> >==---------- >> >> http://www.newsfeed.com The #1 Newsgroup Service inthe >> >World! >> >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 >> >Servers =----- >> > >> >A checkbox functions within an HTML form by submitting the usual >> >*name=value* pair when checked, and *nothing* when not. Allreading >the >> >Checkbox.value property programmatically will get you is - the >checkbox >> >value. ;) The default is "on" btw. You want the .checkedproperty, a >> >Boolean. The concatenation will type-convert it to 'true' /'false'. >> >Hope I understood your Q. >> Thanks for your reply Rob. I think I understand what you'resaying. >What is the JS code to >> reference the checked property (boolean)? >> >> Thanks, >> Don >> >> >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >==---------- >> http://www.newsfeed.com The #1 Newsgroup Service in the >World! >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 >Servers =----- > >Assuming there's only one element of that name, same as you're using- >with the substitution of 'checked' for 'value'. Or: give the cb an >id="foo" (or whatever) and use document.getElementById("foo"). > >If you want the actual value if checked, and nothing (empty string)if >unchecked, use: > >document.cookie = >"cpceRememberLoginCookie=" + >((document.getPage1.rememberLogin.checked) ? >document.getPage1.rememberLogin.value : "") + >"; expires=Thr,01-Jan-2015 00:00:00 GMT" + >"; path=/"; > >http://www.quirksmode.org/js/cookies.html Thanks Rob. However, I'm not sure I understand the use of "?" and ":" in the following: ((document.getPage1.rememberLogin.checked) ? document.getPage1.rememberLogin.value : ""). Could you explain that please. Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
Conditional operator [ (condition) ? if-true : if-false ]
((document.getPage1.rememberLogin.checked) ? ---> box checked? document.getPage1.rememberLogin.value ---> yes, get value : ---> else "") ---> no, use empty string
Just a more compact form of if-else. Can be cascaded:
(condition) ? if-true : (2nd condition) ? if-true : (3rd condition) ? if-true : if-false ...something like switch/case. The latter is faster, however.
I see. That makes sense now. I'm anxious to give it a try. Gotta go do some Christmas shopping
right now. Thanks again, and have a very Happy Holiday Season.
Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John E |
last post by:
How do I get whether a checkbox is ticked in a form on a form's submission
(true or false)? How do I use the Request object in ASP?
|
by: PhiSYS |
last post by:
I want to know what's wrong with this code (I'm an amateur programmer).
I'm trying to check if every field has a value or if checkboxes/radios
have at least one item checked on each group (yes, you...
|
by: F. Da Costa |
last post by:
Hi,
Does the following indeed imply that this event is NOT called when an <input type="checkbox" is toggled?
This would thus imply the usage of the onClick handler instead (assuming an action...
|
by: soundar rajan |
last post by:
Hi,
I wanna display messagebox, and also at the bottom i wanna display "Dont
show again" with checkbox using VB.NET. Immediate help needed!!!!
|
by: Andrew |
last post by:
Hi,
I have a problem capturing the checkboxes that are checked, I get false
irrespective of wether they are checked or not.
I have gone thru the sample code on this forum, but they dun seem to...
|
by: Jaime Stuardo |
last post by:
Hi all..
I have a DataGrid with checkboxes. In the header I have a "check all"
checkbox.
I'm wondering if there is an easy way to check all checkboxes using that
checkbox. I could do it using...
|
by: spolsky |
last post by:
try the the following code with Opera 9.01 (Windows). when clicked
slightly faster than normal clicking, the toggler checkbox and other
checkboxes displays differently although event method works...
|
by: ascll |
last post by:
Hi,
Do you guy know how to make a ASP.net 2.0 checkbox "read-only"?
Thanks.
|
by: rando1000 |
last post by:
So I have this form that captures Me.CheckboxName.Value as part of an SQL statement. For one checkbox, it evaluates as 0, which is great, because I'm filling a Yes/No field with it. But for another...
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |