Jump to content
Sign in to follow this  
JKlingenberg

Need "Must Agree To Terms" Modification Needed!

Recommended Posts

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

Share this post


Link to post
Share on other sites

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


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! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

post your code


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! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
Share on other sites

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;
}
}


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! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Share this post


Link to post
Share on other sites

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??

Share this post


Link to post
Share on other sites

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


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! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

Anyone with any idea on how to modify the JAVA to verify and require 3 checkboxes to be selected?

 

Don't be shy!

 

Thanks....

Share this post


Link to post
Share on other sites

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.....

Share this post


Link to post
Share on other sites

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:


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)

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

If you email me the file to

 

mark@freelancephp.co.uk

 

I will take a look for you :)


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)

Share this post


Link to post
Share on other sites
Guest

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×