cancel
Showing results for 
Search instead for 
Did you mean: 

Accept Hosted -Call java script on click of pay button

Hi ,

 

We are using accept hosted form that embeded in our main page in iframe.(no popup).

Now along with this page we have terms and condition checkbox in main page and this should be check before submitting payment.

 

Can we add such kind of validation before clicking on pay in accept hosted form.

raviparmarce88
Regular Contributor
2 REPLIES 2

One way, using Jquery: 

<input class="accept_terms" type="checkbox" name="accept_terms" value="1" onchange="valueChanged()"/>

<script type="text/javascript">
function valueChanged()
{
    if($('.accept_terms').is(":checked"))   
        $("#IFRAME_DIV").show();
    else
        $("#IFRAME_DIV").hide();
}
</script>

Or another way, would be to start with your iframe div id having a style of display:none; then when the checkbox is selected: 

$("#ACCEPT_TERMS").click(function() {
            $("#IFRAME_DIV").toggle();
        });

 

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Thank you @NexusSoftware,

 

Let me check with you suggestion.