JKlingenberg Posted January 23, 2004 Share Posted January 23, 2004 I've installed the "Must Agree to Terms" (View Contribution) contrib and it works flawlessly, I'm hoping someone can help me modify it to my particular needs... I need 3 (three) check boxes that have to be checked prior to check out. Something like: 1. Agree to terms of event 2. I'm over 18 3. My Vehicle meets minimum requirements I'm guessing it should not be to hard to just have the contrib verify that ALL THREE boxes are check prior to checkout. The links can all link to the same "Terms Document" so I just need to be able to verify all 3 boxes are checked... Any help would be greatly appreciated.... Thanks Quote Link to comment Share on other sites More sharing options...
241 Posted January 23, 2004 Share Posted January 23, 2004 This could be done, but surely you could just stipulate in the text that the person agrees to terms , is over 18 and the vehicle mees requirements, thus only one checkbox for the customer to bother with and they have by checking the box stated that they agree to terms are over 18 and have an a vehicle meeting requirement Quote No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 23, 2004 Author Share Posted January 23, 2004 I agree it could just be 1 box, but my client is very specific that the when a customer registers for an event (the Products), it requires the boxes to be individually acknowledged. They must be over 18, They won't sue if they get hurt... Their Vehicle meets the event requirements and state laws.... If all 3 are not checked, they can't proceed. I've been able to add the 3 boxes, but if ANY are checked it proceeds. I just need the "if" statement to check all 3 boxes. Quote Link to comment Share on other sites More sharing options...
241 Posted January 23, 2004 Share Posted January 23, 2004 post your code Quote No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 23, 2004 Author Share Posted January 23, 2004 here are the code sections as they are in my page... Except now even with all 3 boxes are checked I can't proceed. Thanks for your help. IN HEAD AREA <script language="javascript"><!-- function rowOverEffect(object) { if (document.checkout_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') { document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver'; }} function rowOutEffect(object) { if (document.checkout_confirmation.elements[object].checked) { document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected'; } else { document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents'; }} function checkboxRowEffect(object) { document.checkout_confirmation.elements[object].checked = !document.checkout_confirmation.elements[object].checked; if(document.checkout_confirmation.elements[object].checked) { document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected'; } else { document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver'; }} function check_agree(TheForm) { if (TheForm.agree.checked) { return true; } else { alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>'); return false; }} function rowOverEffect(object) { if (document.age_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') { document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver'; }} function rowOutEffect(object) { if (document.age_confirmation.elements[object].checked) { document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected'; } else { document.age_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents'; }} function checkboxRowEffect(object) { document.age_confirmation.elements[object].checked = !document.age_confirmation.elements[object].checked; if(document.age_confirmation.elements[object].checked) { document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected'; } else { document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver'; }} function check_agree(TheForm2) { if (TheForm2.agree.checked) { return true; } else { alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>'); return false; }} function rowOverEffect(object) { if (document.regs_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') { document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver'; }} function rowOutEffect(object) { if (document.regs_confirmation.elements[object].checked) { document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected'; } else { document.regs_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents'; }} function checkboxRowEffect(object) { document.regs_confirmation.elements[object].checked = !document.regs_confirmation.elements[object].checked; if(document.regs_confirmation.elements[object].checked) { document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected'; } else { document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver'; }} function check_agree(TheForm3) { if (TheForm3.agree.checked) { return true; } else { alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>'); return false; }} //--></script> IN BODY of TEXT STARTING LINE 378 <?php }?> </table></td> </tr> </table></td> </tr><?php } }?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr><?php if (tep_not_null($order->info['comments'])) {?> <tr> <td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php }?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"><?php if (isset($$payment->form_action_url)) { $form_action_url = $$payment->form_action_url; } else { $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } echo tep_draw_form('checkout_confirmation', $form_action_url, 'post', 'onsubmit="return check_agree(this);"'); if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); }?> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents" onmouseover="rowOverEffect('agree')" onmouseout="rowOutEffect('agree')" onclick="checkboxRowEffect('agree')"> <td class="main" align="right"><b><?php echo CONDITION_AGREEMENT; ?></b> <?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="checkboxRowEffect(\'agree\')"'); ?></td> </tr> <tr class="infoBoxContents" onmouseover="rowOverEffect('agree')" onmouseout="rowOutEffect('agree')" onclick="checkboxRowEffect('agree')"> <td class="main" align="right"><b><?php echo AGE_AGREEMENT; ?></b> <?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="checkboxRowEffect(\'agree\')"'); ?></td> </tr> <tr class="infoBoxContents" onmouseover="rowOverEffect('agree')" onmouseout="rowOutEffect('agree')" onclick="checkboxRowEffect('agree')"> <td class="main" align="right"><b><?php echo REGS_AGREEMENT; ?></b> <?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="checkboxRowEffect(\'agree\')"'); ?></td> </tr> </table></td> </tr> Quote Link to comment Share on other sites More sharing options...
241 Posted January 23, 2004 Share Posted January 23, 2004 something along this line If (TheForm.agree.checked, TheForm2.agree.checked, TheForm3.agree.checked) { return true; } else { alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>'); return false; } } or If [(TheForm.agree.checked), (TheForm2.agree.checked), (TheForm3.agree.checked)] { return true; } else { alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>'); return false; } } Quote No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 23, 2004 Author Share Posted January 23, 2004 Thanks for those... Question... Since i have 3 "IF" statements, do I replace them all with this or do I only have one at the bottom of the script?? Quote Link to comment Share on other sites More sharing options...
241 Posted January 23, 2004 Share Posted January 23, 2004 I am not sure if hte codes I have given are even in the correct form as I have not tried them they are there to give thought to you. You may be able to replace all with one Quote No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 23, 2004 Author Share Posted January 23, 2004 Thanks for the feedback, Unfortunately it's not helping with verifying that all 3 boxes are checked. I'll have to keep testing unless someone else has any thoughts... Quote Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 24, 2004 Author Share Posted January 24, 2004 Anyone with any idea on how to modify the JAVA to verify and require 3 checkboxes to be selected? Don't be shy! Thanks.... Quote Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 24, 2004 Author Share Posted January 24, 2004 So.... nobody wants to help a fellow web designer out a bit? Just take a glance at the java code and tell me how I can verify that 3 check boxes are checked?.... c'mon somebody plz..... Quote Link to comment Share on other sites More sharing options...
Mark Evans Posted January 24, 2004 Share Posted January 24, 2004 A hint for you :-) You are using the same field names for all 3 checkboxes..... maybe it could be an idea to use 3 different names :unsure: Quote Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds) Link to comment Share on other sites More sharing options...
JKlingenberg Posted January 25, 2004 Author Share Posted January 25, 2004 Mark, I know i'm doing something wrong... Unfortunately i have to confess that I'm just a novis at Java and PHP, but that is why i'm here... to learn from the masters... Could you (PLEASE) help me identify the "field names" in my script... :unsure: So I can give each box a differnt name... I know i'm just being dense, but this is still VERY new to me... :blink: Quote Link to comment Share on other sites More sharing options...
Mark Evans Posted January 25, 2004 Share Posted January 25, 2004 If you email me the file to [email protected] I will take a look for you :) Quote Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds) Link to comment Share on other sites More sharing options...
Guest Posted May 4, 2004 Share Posted May 4, 2004 Great contribution, works to a level for me, I get a java error box popup in IE. I do not get the same error in opera. Here is the error: A Runtime Error Has Occurred. Do you wish to debug? Line 330 Error: Object Expected If I click no I get this error: A Runtime Error Has Occurred. Do you wish to debug? Line 325 Error: Object Expected If I click no It works and carries through to end of checkout process any help plz. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.