Reply
Highlighted
Regular Contributor
Posts: 74
Registered: ‎03-21-2017

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.

Highlighted
Posts: 427
Topics: 0
Kudos: 88
Blog Posts: 0
Ideas: 0
Solutions: 34
Registered: ‎04-28-2017

Re: Accept Hosted -Call java script on click of pay button

[ Edited ]

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
Highlighted
Regular Contributor
Posts: 74
Registered: ‎03-21-2017

Re: Accept Hosted -Call java script on click of pay button

Thank you @NexusSoftware,

 

Let me check with you suggestion.