| Home | Forums | Reviews | Articles | Register |
![]() |
| Thread Tools | Rate Thread |
|
Russell
Guest
Posts: n/a
|
Hello ,
I have a page that has multiple check boxes. I would like to make sure that at least one check box is checked before the submit button sends the form off to a shopping cart. Any help is appreciated. Thanks, Russell http://www.kenortongallery.com/lands...ricanlight.htm |
|
||
|
||||
|
|
|
| |
|
Kathleen Anderson [MVP - FrontPage]
Guest
Posts: n/a
|
With JavaScript: http://www.codeave.com/javascript/code.asp?u_log=7062
-- ~ Kathleen Anderson Microsoft MVP - FrontPage Spider Web Woman Designs web: http://www.spiderwebwoman.com/resources/ "Russell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > Hello , > > I have a page that has multiple check boxes. I would like to make sure > that at least one check box is checked before the submit button sends the > form off to a shopping cart. Any help is appreciated. > > Thanks, > > Russell > > http://www.kenortongallery.com/lands...ricanlight.htm > > |
|
||
|
||||
|
Russell
Guest
Posts: n/a
|
TY Kathleen
But that script proved too complicated for me. I was able to get it to do what I wanted in its "own" page but upon pasting into my page it did not work . I pasted this: <script Language="JavaScript"> <!-- function checkbox_checker() { // set var checkbox_choices to zero var checkbox_choices = 0; // Loop from zero to the one minus the number of checkbox button selections for (counter = 0; counter < checkbox_form.checkbox.length; counter++) { // If a checkbox has been selected it will return true // (If not it will return false) if (checkbox_form.checkbox[counter].checked) { checkbox_choices = checkbox_choices + 1; } } if (checkbox_choices < 1 ) { // If there were less then selections made display an alert box alert("Please make a selection.") return (false); } } --> </script> And this : <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" onsubmit="return checkbox_checker()" name="checkbox_form"> And get the results : checkbox_form.checkbox.length is null or not an object. Any other hints for me? Thanks Russell "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > With JavaScript: http://www.codeave.com/javascript/code.asp?u_log=7062 > > -- > ~ Kathleen Anderson > Microsoft MVP - FrontPage > Spider Web Woman Designs > web: http://www.spiderwebwoman.com/resources/ > > > "Russell" <(E-Mail Removed)> wrote in message > news:(E-Mail Removed)... > > Hello , > > > > I have a page that has multiple check boxes. I would like to make sure > > that at least one check box is checked before the submit button sends the > > form off to a shopping cart. Any help is appreciated. > > > > Thanks, > > > > Russell > > > > http://www.kenortongallery.com/lands...ricanlight.htm > > > > > > |
|
||
|
||||
|
Stefan B Rusynko
Guest
Posts: n/a
|
Are all your check boxes in your form named checkbox per the sample code
<input type="checkbox" value="Hank Aaron" name="checkbox">Hank Aaron<br> That's what checkbox_form.checkbox.length is looking for -- _____________________________________________ SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] "Warning - Using the F1 Key will not break anything!" (-; To find the best Newsgroup for FrontPage support see: http://www.frontpagemvps.com/FrontPa...3/Default.aspx _____________________________________________ "Russell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... | TY Kathleen | | But that script proved too complicated for me. I was able to get it to do | what I wanted in its "own" page but upon pasting into my page it did not | work . | | I pasted this: | | <script Language="JavaScript"> | <!-- | function checkbox_checker() | { | | // set var checkbox_choices to zero | | var checkbox_choices = 0; | | // Loop from zero to the one minus the number of checkbox button selections | for (counter = 0; counter < checkbox_form.checkbox.length; counter++) | { | | // If a checkbox has been selected it will return true | // (If not it will return false) | if (checkbox_form.checkbox[counter].checked) | { checkbox_choices = checkbox_choices + 1; } | | } | if (checkbox_choices < 1 ) | { | // If there were less then selections made display an alert box | alert("Please make a selection.") | return (false); | } | } | | --> | </script> | | And this : | | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" onsubmit="return | checkbox_checker()" name="checkbox_form"> | | | And get the results : checkbox_form.checkbox.length is null or not | an object. | | Any other hints for me? | | Thanks | | Russell | | | | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in | message news:(E-Mail Removed)... | > With JavaScript: http://www.codeave.com/javascript/code.asp?u_log=7062 | > | > -- | > ~ Kathleen Anderson | > Microsoft MVP - FrontPage | > Spider Web Woman Designs | > web: http://www.spiderwebwoman.com/resources/ | > | > | > "Russell" <(E-Mail Removed)> wrote in message | > news:(E-Mail Removed)... | > > Hello , | > > | > > I have a page that has multiple check boxes. I would like to make sure | > > that at least one check box is checked before the submit button sends | the | > > form off to a shopping cart. Any help is appreciated. | > > | > > Thanks, | > > | > > Russell | > > | > > http://www.kenortongallery.com/lands...ricanlight.htm | > > | > > | > | > | | |
|
||
|
||||
|
Russell
Guest
Posts: n/a
|
Thanks Stefan.
I changed the names of the checkboxes and that script works fine. Problem is my shopping cart expects the checkbox names to be multi-item1, multi-item2, etc. I can't change those names and still have the shopping cart place a checked item in the cart. Any suggestions? Thanks Russell "Stefan B Rusynko" <(E-Mail Removed)> wrote in message news:ud$(E-Mail Removed)... > Are all your check boxes in your form named checkbox per the sample code > <input type="checkbox" value="Hank Aaron" name="checkbox">Hank Aaron<br> > That's what checkbox_form.checkbox.length is looking for > -- > > _____________________________________________ > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] > "Warning - Using the F1 Key will not break anything!" (-; > To find the best Newsgroup for FrontPage support see: > http://www.frontpagemvps.com/FrontPa...3/Default.aspx > _____________________________________________ > > > "Russell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > | TY Kathleen > | > | But that script proved too complicated for me. I was able to get it to do > | what I wanted in its "own" page but upon pasting into my page it did not > | work . > | > | I pasted this: > | > | <script Language="JavaScript"> > | <!-- > | function checkbox_checker() > | { > | > | // set var checkbox_choices to zero > | > | var checkbox_choices = 0; > | > | // Loop from zero to the one minus the number of checkbox button selections > | for (counter = 0; counter < checkbox_form.checkbox.length; counter++) > | { > | > | // If a checkbox has been selected it will return true > | // (If not it will return false) > | if (checkbox_form.checkbox[counter].checked) > | { checkbox_choices = checkbox_choices + 1; } > | > | } > | if (checkbox_choices < 1 ) > | { > | // If there were less then selections made display an alert box > | alert("Please make a selection.") > | return (false); > | } > | } > | > | --> > | </script> > | > | And this : > | > | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" onsubmit="return > | checkbox_checker()" name="checkbox_form"> > | > | > | And get the results : checkbox_form.checkbox.length is null or not > | an object. > | > | Any other hints for me? > | > | Thanks > | > | Russell > | > | > | > | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in > | message news:(E-Mail Removed)... > | > With JavaScript: http://www.codeave.com/javascript/code.asp?u_log=7062 > | > > | > -- > | > ~ Kathleen Anderson > | > Microsoft MVP - FrontPage > | > Spider Web Woman Designs > | > web: http://www.spiderwebwoman.com/resources/ > | > > | > > | > "Russell" <(E-Mail Removed)> wrote in message > | > news:(E-Mail Removed)... > | > > Hello , > | > > > | > > I have a page that has multiple check boxes. I would like to make sure > | > > that at least one check box is checked before the submit button sends > | the > | > > form off to a shopping cart. Any help is appreciated. > | > > > | > > Thanks, > | > > > | > > Russell > | > > > | > > http://www.kenortongallery.com/lands...ricanlight.htm > | > > > | > > > | > > | > > | > | > > |
|
||
|
||||
|
Thomas A. Rowe
Guest
Posts: n/a
|
Have you contact your shopping cart vendor for help with this issue?
-- ============================================== Thomas A. Rowe (Microsoft MVP - FrontPage) ============================================== If you feel your current issue is a results of installing a Service Pack or security update, please contact Microsoft Product Support Services: http://support.microsoft.com If the problem can be shown to have been caused by a security update, then there is usually no charge for the call. ============================================== "Russell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > Thanks Stefan. > > I changed the names of the checkboxes and that script works fine. Problem is > my shopping cart expects the checkbox names to be multi-item1, multi-item2, > etc. I can't change those names and still have the shopping cart place a > checked item in the cart. Any suggestions? > > Thanks > > Russell > > "Stefan B Rusynko" <(E-Mail Removed)> wrote in message > news:ud$(E-Mail Removed)... >> Are all your check boxes in your form named checkbox per the sample code >> <input type="checkbox" value="Hank Aaron" name="checkbox">Hank Aaron<br> >> That's what checkbox_form.checkbox.length is looking for >> -- >> >> _____________________________________________ >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] >> "Warning - Using the F1 Key will not break anything!" (-; >> To find the best Newsgroup for FrontPage support see: >> http://www.frontpagemvps.com/FrontPa...3/Default.aspx >> _____________________________________________ >> >> >> "Russell" <(E-Mail Removed)> wrote in message > news:(E-Mail Removed)... >> | TY Kathleen >> | >> | But that script proved too complicated for me. I was able to get it to > do >> | what I wanted in its "own" page but upon pasting into my page it did not >> | work . >> | >> | I pasted this: >> | >> | <script Language="JavaScript"> >> | <!-- >> | function checkbox_checker() >> | { >> | >> | // set var checkbox_choices to zero >> | >> | var checkbox_choices = 0; >> | >> | // Loop from zero to the one minus the number of checkbox button > selections >> | for (counter = 0; counter < checkbox_form.checkbox.length; counter++) >> | { >> | >> | // If a checkbox has been selected it will return true >> | // (If not it will return false) >> | if (checkbox_form.checkbox[counter].checked) >> | { checkbox_choices = checkbox_choices + 1; } >> | >> | } >> | if (checkbox_choices < 1 ) >> | { >> | // If there were less then selections made display an alert box >> | alert("Please make a selection.") >> | return (false); >> | } >> | } >> | >> | --> >> | </script> >> | >> | And this : >> | >> | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" > onsubmit="return >> | checkbox_checker()" name="checkbox_form"> >> | >> | >> | And get the results : checkbox_form.checkbox.length is null or > not >> | an object. >> | >> | Any other hints for me? >> | >> | Thanks >> | >> | Russell >> | >> | >> | >> | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in >> | message news:(E-Mail Removed)... >> | > With JavaScript: http://www.codeave.com/javascript/code.asp?u_log=7062 >> | > >> | > -- >> | > ~ Kathleen Anderson >> | > Microsoft MVP - FrontPage >> | > Spider Web Woman Designs >> | > web: http://www.spiderwebwoman.com/resources/ >> | > >> | > >> | > "Russell" <(E-Mail Removed)> wrote in message >> | > news:(E-Mail Removed)... >> | > > Hello , >> | > > >> | > > I have a page that has multiple check boxes. I would like to make > sure >> | > > that at least one check box is checked before the submit button > sends >> | the >> | > > form off to a shopping cart. Any help is appreciated. >> | > > >> | > > Thanks, >> | > > >> | > > Russell >> | > > >> | > > http://www.kenortongallery.com/lands...ricanlight.htm >> | > > >> | > > >> | > >> | > >> | >> | >> >> > > |
|
||
|
||||
|
Russell
Guest
Posts: n/a
|
No I haven' to. I don't see it as a cart issue. The cart works fine. I
would just like to prevent submission to the cart with empty check boxes. Its not a big deal, but to some, I suspect it might be annoying. Not really knowing JavaScript, but having seen what can be done, I didn't think it would be too difficult to check for input before submitting the forms. Any other suggestions how to do this? Thank You. Russell "Thomas A. Rowe" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)... > Have you contact your shopping cart vendor for help with this issue? > > -- > ============================================== > Thomas A. Rowe (Microsoft MVP - FrontPage) > ============================================== > If you feel your current issue is a results of installing > a Service Pack or security update, please contact > Microsoft Product Support Services: > http://support.microsoft.com > If the problem can be shown to have been caused by a > security update, then there is usually no charge for the call. > ============================================== > > "Russell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > > Thanks Stefan. > > > > I changed the names of the checkboxes and that script works fine. Problem is > > my shopping cart expects the checkbox names to be multi-item1, multi-item2, > > etc. I can't change those names and still have the shopping cart place a > > checked item in the cart. Any suggestions? > > > > Thanks > > > > Russell > > > > "Stefan B Rusynko" <(E-Mail Removed)> wrote in message > > news:ud$(E-Mail Removed)... > >> Are all your check boxes in your form named checkbox per the sample code > >> <input type="checkbox" value="Hank Aaron" name="checkbox">Hank Aaron<br> > >> That's what checkbox_form.checkbox.length is looking for > >> -- > >> > >> _____________________________________________ > >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] > >> "Warning - Using the F1 Key will not break anything!" (-; > >> To find the best Newsgroup for FrontPage support see: > >> http://www.frontpagemvps.com/FrontPa...3/Default.aspx > >> _____________________________________________ > >> > >> > >> "Russell" <(E-Mail Removed)> wrote in message > > news:(E-Mail Removed)... > >> | TY Kathleen > >> | > >> | But that script proved too complicated for me. I was able to get it to > > do > >> | what I wanted in its "own" page but upon pasting into my page it did not > >> | work . > >> | > >> | I pasted this: > >> | > >> | <script Language="JavaScript"> > >> | <!-- > >> | function checkbox_checker() > >> | { > >> | > >> | // set var checkbox_choices to zero > >> | > >> | var checkbox_choices = 0; > >> | > >> | // Loop from zero to the one minus the number of checkbox button > > selections > >> | for (counter = 0; counter < checkbox_form.checkbox.length; counter++) > >> | { > >> | > >> | // If a checkbox has been selected it will return true > >> | // (If not it will return false) > >> | if (checkbox_form.checkbox[counter].checked) > >> | { checkbox_choices = checkbox_choices + 1; } > >> | > >> | } > >> | if (checkbox_choices < 1 ) > >> | { > >> | // If there were less then selections made display an alert box > >> | alert("Please make a selection.") > >> | return (false); > >> | } > >> | } > >> | > >> | --> > >> | </script> > >> | > >> | And this : > >> | > >> | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" > > onsubmit="return > >> | checkbox_checker()" name="checkbox_form"> > >> | > >> | > >> | And get the results : checkbox_form.checkbox.length is null or > > not > >> | an object. > >> | > >> | Any other hints for me? > >> | > >> | Thanks > >> | > >> | Russell > >> | > >> | > >> | > >> | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in > >> | message news:(E-Mail Removed)... > >> | > With JavaScript: http://www.codeave.com/javascript/code.asp?u_log=7062 > >> | > > >> | > -- > >> | > ~ Kathleen Anderson > >> | > Microsoft MVP - FrontPage > >> | > Spider Web Woman Designs > >> | > web: http://www.spiderwebwoman.com/resources/ > >> | > > >> | > > >> | > "Russell" <(E-Mail Removed)> wrote in message > >> | > news:(E-Mail Removed)... > >> | > > Hello , > >> | > > > >> | > > I have a page that has multiple check boxes. I would like to make > > sure > >> | > > that at least one check box is checked before the submit button > > sends > >> | the > >> | > > form off to a shopping cart. Any help is appreciated. > >> | > > > >> | > > Thanks, > >> | > > > >> | > > Russell > >> | > > > >> | > > http://www.kenortongallery.com/lands...ricanlight.htm > >> | > > > >> | > > > >> | > > >> | > > >> | > >> | > >> > >> > > > > > > |
|
||
|
||||
|
Thomas A. Rowe
Guest
Posts: n/a
|
It is not a FP issue either, it is a cart issue, since you must name each checkbox uniquely, the
author may have a solution. -- ============================================== Thomas A. Rowe (Microsoft MVP - FrontPage) ============================================== If you feel your current issue is a results of installing a Service Pack or security update, please contact Microsoft Product Support Services: http://support.microsoft.com If the problem can be shown to have been caused by a security update, then there is usually no charge for the call. ============================================== "Russell" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)... > No I haven' to. I don't see it as a cart issue. The cart works fine. I > would just like to prevent submission to the cart with empty check boxes. > Its not a big deal, but to some, I suspect it might be annoying. > Not really knowing JavaScript, but having seen what can be done, I didn't > think it would be too difficult to check for input before submitting the > forms. > > Any other suggestions how to do this? > > Thank You. > > Russell > > > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message > news:%(E-Mail Removed)... >> Have you contact your shopping cart vendor for help with this issue? >> >> -- >> ============================================== >> Thomas A. Rowe (Microsoft MVP - FrontPage) >> ============================================== >> If you feel your current issue is a results of installing >> a Service Pack or security update, please contact >> Microsoft Product Support Services: >> http://support.microsoft.com >> If the problem can be shown to have been caused by a >> security update, then there is usually no charge for the call. >> ============================================== >> >> "Russell" <(E-Mail Removed)> wrote in message > news:(E-Mail Removed)... >> > Thanks Stefan. >> > >> > I changed the names of the checkboxes and that script works fine. > Problem is >> > my shopping cart expects the checkbox names to be multi-item1, > multi-item2, >> > etc. I can't change those names and still have the shopping cart place a >> > checked item in the cart. Any suggestions? >> > >> > Thanks >> > >> > Russell >> > >> > "Stefan B Rusynko" <(E-Mail Removed)> wrote in message >> > news:ud$(E-Mail Removed)... >> >> Are all your check boxes in your form named checkbox per the sample > code >> >> <input type="checkbox" value="Hank Aaron" name="checkbox">Hank > Aaron<br> >> >> That's what checkbox_form.checkbox.length is looking for >> >> -- >> >> >> >> _____________________________________________ >> >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] >> >> "Warning - Using the F1 Key will not break anything!" (-; >> >> To find the best Newsgroup for FrontPage support see: >> >> > http://www.frontpagemvps.com/FrontPa...3/Default.aspx >> >> _____________________________________________ >> >> >> >> >> >> "Russell" <(E-Mail Removed)> wrote in message >> > news:(E-Mail Removed)... >> >> | TY Kathleen >> >> | >> >> | But that script proved too complicated for me. I was able to get it > to >> > do >> >> | what I wanted in its "own" page but upon pasting into my page it did > not >> >> | work . >> >> | >> >> | I pasted this: >> >> | >> >> | <script Language="JavaScript"> >> >> | <!-- >> >> | function checkbox_checker() >> >> | { >> >> | >> >> | // set var checkbox_choices to zero >> >> | >> >> | var checkbox_choices = 0; >> >> | >> >> | // Loop from zero to the one minus the number of checkbox button >> > selections >> >> | for (counter = 0; counter < checkbox_form.checkbox.length; counter++) >> >> | { >> >> | >> >> | // If a checkbox has been selected it will return true >> >> | // (If not it will return false) >> >> | if (checkbox_form.checkbox[counter].checked) >> >> | { checkbox_choices = checkbox_choices + 1; } >> >> | >> >> | } >> >> | if (checkbox_choices < 1 ) >> >> | { >> >> | // If there were less then selections made display an alert box >> >> | alert("Please make a selection.") >> >> | return (false); >> >> | } >> >> | } >> >> | >> >> | --> >> >> | </script> >> >> | >> >> | And this : >> >> | >> >> | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" >> > onsubmit="return >> >> | checkbox_checker()" name="checkbox_form"> >> >> | >> >> | >> >> | And get the results : checkbox_form.checkbox.length is null > or >> > not >> >> | an object. >> >> | >> >> | Any other hints for me? >> >> | >> >> | Thanks >> >> | >> >> | Russell >> >> | >> >> | >> >> | >> >> | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote > in >> >> | message news:(E-Mail Removed)... >> >> | > With JavaScript: > http://www.codeave.com/javascript/code.asp?u_log=7062 >> >> | > >> >> | > -- >> >> | > ~ Kathleen Anderson >> >> | > Microsoft MVP - FrontPage >> >> | > Spider Web Woman Designs >> >> | > web: http://www.spiderwebwoman.com/resources/ >> >> | > >> >> | > >> >> | > "Russell" <(E-Mail Removed)> wrote in message >> >> | > news:(E-Mail Removed)... >> >> | > > Hello , >> >> | > > >> >> | > > I have a page that has multiple check boxes. I would like to > make >> > sure >> >> | > > that at least one check box is checked before the submit button >> > sends >> >> | the >> >> | > > form off to a shopping cart. Any help is appreciated. >> >> | > > >> >> | > > Thanks, >> >> | > > >> >> | > > Russell >> >> | > > >> >> | > > http://www.kenortongallery.com/lands...ricanlight.htm >> >> | > > >> >> | > > >> >> | > >> >> | > >> >> | >> >> | >> >> >> >> >> > >> > >> >> > > |
|
||
|
||||
|
Russell
Guest
Posts: n/a
|
Thanks Thomas
"Thomas A. Rowe" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > It is not a FP issue either, it is a cart issue, since you must name each checkbox uniquely, the > author may have a solution. > > -- > ============================================== > Thomas A. Rowe (Microsoft MVP - FrontPage) > ============================================== > If you feel your current issue is a results of installing > a Service Pack or security update, please contact > Microsoft Product Support Services: > http://support.microsoft.com > If the problem can be shown to have been caused by a > security update, then there is usually no charge for the call. > ============================================== > > "Russell" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)... > > No I haven' to. I don't see it as a cart issue. The cart works fine. I > > would just like to prevent submission to the cart with empty check boxes. > > Its not a big deal, but to some, I suspect it might be annoying. > > Not really knowing JavaScript, but having seen what can be done, I didn't > > think it would be too difficult to check for input before submitting the > > forms. > > > > Any other suggestions how to do this? > > > > Thank You. > > > > Russell > > > > > > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message > > news:%(E-Mail Removed)... > >> Have you contact your shopping cart vendor for help with this issue? > >> > >> -- > >> ============================================== > >> Thomas A. Rowe (Microsoft MVP - FrontPage) > >> ============================================== > >> If you feel your current issue is a results of installing > >> a Service Pack or security update, please contact > >> Microsoft Product Support Services: > >> http://support.microsoft.com > >> If the problem can be shown to have been caused by a > >> security update, then there is usually no charge for the call. > >> ============================================== > >> > >> "Russell" <(E-Mail Removed)> wrote in message > > news:(E-Mail Removed)... > >> > Thanks Stefan. > >> > > >> > I changed the names of the checkboxes and that script works fine. > > Problem is > >> > my shopping cart expects the checkbox names to be multi-item1, > > multi-item2, > >> > etc. I can't change those names and still have the shopping cart place a > >> > checked item in the cart. Any suggestions? > >> > > >> > Thanks > >> > > >> > Russell > >> > > >> > "Stefan B Rusynko" <(E-Mail Removed)> wrote in message > >> > news:ud$(E-Mail Removed)... > >> >> Are all your check boxes in your form named checkbox per the sample > > code > >> >> <input type="checkbox" value="Hank Aaron" name="checkbox">Hank > > Aaron<br> > >> >> That's what checkbox_form.checkbox.length is looking for > >> >> -- > >> >> > >> >> _____________________________________________ > >> >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] > >> >> "Warning - Using the F1 Key will not break anything!" (-; > >> >> To find the best Newsgroup for FrontPage support see: > >> >> > > http://www.frontpagemvps.com/FrontPa...3/Default.aspx > >> >> _____________________________________________ > >> >> > >> >> > >> >> "Russell" <(E-Mail Removed)> wrote in message > >> > news:(E-Mail Removed)... > >> >> | TY Kathleen > >> >> | > >> >> | But that script proved too complicated for me. I was able to get it > > to > >> > do > >> >> | what I wanted in its "own" page but upon pasting into my page it did > > not > >> >> | work . > >> >> | > >> >> | I pasted this: > >> >> | > >> >> | <script Language="JavaScript"> > >> >> | <!-- > >> >> | function checkbox_checker() > >> >> | { > >> >> | > >> >> | // set var checkbox_choices to zero > >> >> | > >> >> | var checkbox_choices = 0; > >> >> | > >> >> | // Loop from zero to the one minus the number of checkbox button > >> > selections > >> >> | for (counter = 0; counter < checkbox_form.checkbox.length; counter++) > >> >> | { > >> >> | > >> >> | // If a checkbox has been selected it will return true > >> >> | // (If not it will return false) > >> >> | if (checkbox_form.checkbox[counter].checked) > >> >> | { checkbox_choices = checkbox_choices + 1; } > >> >> | > >> >> | } > >> >> | if (checkbox_choices < 1 ) > >> >> | { > >> >> | // If there were less then selections made display an alert box > >> >> | alert("Please make a selection.") > >> >> | return (false); > >> >> | } > >> >> | } > >> >> | > >> >> | --> > >> >> | </script> > >> >> | > >> >> | And this : > >> >> | > >> >> | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" > >> > onsubmit="return > >> >> | checkbox_checker()" name="checkbox_form"> > >> >> | > >> >> | > >> >> | And get the results : checkbox_form.checkbox.length is null > > or > >> > not > >> >> | an object. > >> >> | > >> >> | Any other hints for me? > >> >> | > >> >> | Thanks > >> >> | > >> >> | Russell > >> >> | > >> >> | > >> >> | > >> >> | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote > > in > >> >> | message news:(E-Mail Removed)... > >> >> | > With JavaScript: > > http://www.codeave.com/javascript/code.asp?u_log=7062 > >> >> | > > >> >> | > -- > >> >> | > ~ Kathleen Anderson > >> >> | > Microsoft MVP - FrontPage > >> >> | > Spider Web Woman Designs > >> >> | > web: http://www.spiderwebwoman.com/resources/ > >> >> | > > >> >> | > > >> >> | > "Russell" <(E-Mail Removed)> wrote in message > >> >> | > news:(E-Mail Removed)... > >> >> | > > Hello , > >> >> | > > > >> >> | > > I have a page that has multiple check boxes. I would like to > > make > >> > sure > >> >> | > > that at least one check box is checked before the submit button > >> > sends > >> >> | the > >> >> | > > form off to a shopping cart. Any help is appreciated. > >> >> | > > > >> >> | > > Thanks, > >> >> | > > > >> >> | > > Russell > >> >> | > > > >> >> | > > http://www.kenortongallery.com/lands...ricanlight.htm > >> >> | > > > >> >> | > > > >> >> | > > >> >> | > > >> >> | > >> >> | > >> >> > >> >> > >> > > >> > > >> > >> > > > > > > |
|
||
|
||||
|
Russell
Guest
Posts: n/a
|
Well the author didn't have a solution... Anyone else? All I want to do is
make sure one of 2 or 3 checkboxes is checked off. All the checkboxes must have unique names. Much appreciated, Russell "Russell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > Thanks Thomas > > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message > news:(E-Mail Removed)... > > It is not a FP issue either, it is a cart issue, since you must name each > checkbox uniquely, the > > author may have a solution. > > > > -- > > ============================================== > > Thomas A. Rowe (Microsoft MVP - FrontPage) > > ============================================== > > If you feel your current issue is a results of installing > > a Service Pack or security update, please contact > > Microsoft Product Support Services: > > http://support.microsoft.com > > If the problem can be shown to have been caused by a > > security update, then there is usually no charge for the call. > > ============================================== > > > > "Russell" <(E-Mail Removed)> wrote in message > news:%(E-Mail Removed)... > > > No I haven' to. I don't see it as a cart issue. The cart works fine. I > > > would just like to prevent submission to the cart with empty check > boxes. > > > Its not a big deal, but to some, I suspect it might be annoying. > > > Not really knowing JavaScript, but having seen what can be done, I > didn't > > > think it would be too difficult to check for input before submitting the > > > forms. > > > > > > Any other suggestions how to do this? > > > > > > Thank You. > > > > > > Russell > > > > > > > > > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message > > > news:%(E-Mail Removed)... > > >> Have you contact your shopping cart vendor for help with this issue? > > >> > > >> -- > > >> ============================================== > > >> Thomas A. Rowe (Microsoft MVP - FrontPage) > > >> ============================================== > > >> If you feel your current issue is a results of installing > > >> a Service Pack or security update, please contact > > >> Microsoft Product Support Services: > > >> http://support.microsoft.com > > >> If the problem can be shown to have been caused by a > > >> security update, then there is usually no charge for the call. > > >> ============================================== > > >> > > >> "Russell" <(E-Mail Removed)> wrote in message > > > news:(E-Mail Removed)... > > >> > Thanks Stefan. > > >> > > > >> > I changed the names of the checkboxes and that script works fine. > > > Problem is > > >> > my shopping cart expects the checkbox names to be multi-item1, > > > multi-item2, > > >> > etc. I can't change those names and still have the shopping cart > place a > > >> > checked item in the cart. Any suggestions? > > >> > > > >> > Thanks > > >> > > > >> > Russell > > >> > > > >> > "Stefan B Rusynko" <(E-Mail Removed)> wrote in message > > >> > news:ud$(E-Mail Removed)... > > >> >> Are all your check boxes in your form named checkbox per the sample > > > code > > >> >> <input type="checkbox" value="Hank Aaron" name="checkbox">Hank > > > Aaron<br> > > >> >> That's what checkbox_form.checkbox.length is looking for > > >> >> -- > > >> >> > > >> >> _____________________________________________ > > >> >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] > > >> >> "Warning - Using the F1 Key will not break anything!" (-; > > >> >> To find the best Newsgroup for FrontPage support see: > > >> >> > > > http://www.frontpagemvps.com/FrontPa...3/Default.aspx > > >> >> _____________________________________________ > > >> >> > > >> >> > > >> >> "Russell" <(E-Mail Removed)> wrote in message > > >> > news:(E-Mail Removed)... > > >> >> | TY Kathleen > > >> >> | > > >> >> | But that script proved too complicated for me. I was able to get > it > > > to > > >> > do > > >> >> | what I wanted in its "own" page but upon pasting into my page it > did > > > not > > >> >> | work . > > >> >> | > > >> >> | I pasted this: > > >> >> | > > >> >> | <script Language="JavaScript"> > > >> >> | <!-- > > >> >> | function checkbox_checker() > > >> >> | { > > >> >> | > > >> >> | // set var checkbox_choices to zero > > >> >> | > > >> >> | var checkbox_choices = 0; > > >> >> | > > >> >> | // Loop from zero to the one minus the number of checkbox button > > >> > selections > > >> >> | for (counter = 0; counter < checkbox_form.checkbox.length; > counter++) > > >> >> | { > > >> >> | > > >> >> | // If a checkbox has been selected it will return true > > >> >> | // (If not it will return false) > > >> >> | if (checkbox_form.checkbox[counter].checked) > > >> >> | { checkbox_choices = checkbox_choices + 1; } > > >> >> | > > >> >> | } > > >> >> | if (checkbox_choices < 1 ) > > >> >> | { > > >> >> | // If there were less then selections made display an alert box > > >> >> | alert("Please make a selection.") > > >> >> | return (false); > > >> >> | } > > >> >> | } > > >> >> | > > >> >> | --> > > >> >> | </script> > > >> >> | > > >> >> | And this : > > >> >> | > > >> >> | <FORM METHOD=POST ACTION="http://www.myurl/cgi-bin/cart.pl" > > >> > onsubmit="return > > >> >> | checkbox_checker()" name="checkbox_form"> > > >> >> | > > >> >> | > > >> >> | And get the results : checkbox_form.checkbox.length is > null > > > or > > >> > not > > >> >> | an object. > > >> >> | > > >> >> | Any other hints for me? > > >> >> | > > >> >> | Thanks > > >> >> | > > >> >> | Russell > > >> >> | > > >> >> | > > >> >> | > > >> >> | "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> > wrote > > > in > > >> >> | message news:(E-Mail Removed)... > > >> >> | > With JavaScript: > > > http://www.codeave.com/javascript/code.asp?u_log=7062 > > >> >> | > > > >> >> | > -- > > >> >> | > ~ Kathleen Anderson > > >> >> | > Microsoft MVP - FrontPage > > >> >> | > Spider Web Woman Designs > > >> >> | > web: http://www.spiderwebwoman.com/resources/ > > >> >> | > > > >> >> | > > > >> >> | > "Russell" <(E-Mail Removed)> wrote in message > > >> >> | > news:(E-Mail Removed)... > > >> >> | > > Hello , > > >> >> | > > > > >> >> | > > I have a page that has multiple check boxes. I would like to > > > make > > >> > sure > > >> >> | > > that at least one check box is checked before the submit > button > > >> > sends > > >> >> | the > > >> >> | > > form off to a shopping cart. Any help is appreciated. > > >> >> | > > > > >> >> | > > Thanks, > > >> >> | > > > > >> >> | > > Russell > > >> >> | > > > > >> >> | > > http://www.kenortongallery.com/lands...ricanlight.htm > > >> >> | > > > > >> >> | > > > > >> >> | > > > >> >> | > > > >> >> | > > >> >> | > > >> >> > > >> >> > > >> > > > >> > > > >> > > >> > > > > > > > > > > > > |
|
||
|
||||
|
|
|
| |
![]() |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access-check box - checked, if checked it opens another form? | Judy | Microsoft Access Getting Started | 1 | 7th Apr 2009 06:15 PM |
| Checking whether or not checkbox on web page is checked | BobRoyAce | Microsoft Dot NET Framework Forms | 1 | 10th Jun 2008 12:19 PM |
| Checking Checked property in ListView | Beebs | Microsoft Dot NET Compact Framework | 2 | 20th Oct 2005 10:03 PM |
| no hit when checking checked checkboxes in datagrid | magmo | Microsoft VB .NET | 2 | 13th Jun 2004 09:01 AM |
| checking if any radio buttons are checked | Remi Lillelien | Microsoft VB .NET | 2 | 6th Apr 2004 11:07 PM |
Powered by vBulletin®. Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2010, Crawlability, Inc. |




