Replies: 0
Hi there,
In my form in the additional setting tab, I have put a code to check for input from the users and according redirect to either PayPal or to another site. Unfortunately in documentation, The method using on_sent_ok hook is no longer recommended. This function is scheduled to be abolished by the end of 2017.
Can you please advice where I can put this code to evaluate the user input. This is very important as we need the form to work for our tournament.
I realize that you mention to put the code in your theme’s template file and to use custom DOM events to run java scripts. I know a little bit of DOM but so good, But I’m not sure where to put the code. Please advice
Code
on_sent_ok: “if (document.getElementById(‘chessrating’).value> 2200) {location.replace(‘http://www.greensborochess.org/thank-you-for-your-participation’)} else if (document.getElementById(‘RegPay’).value== “Register & Pay Later”) {location.replace(‘http://www.greensborochess.org/thank-you-for-your-participation’)} else if (document.getElementById(‘RegPay’).value== “Register for 2200 rated & above” && document.getElementById(‘chessrating’).value< 2200) {location = ‘https://www.paypal.com/?cmd=_xclick&business=greensborochessclub@gmail.com¤cy_code=USD&amount=’+jQuery(‘#Tournamount’).val()+’&return=http://www.greensborochess.org/thank-you-for-your-participation/&rm=2&cancel_return=http://www.greensborochess.org/cancellation-of-g-c-c-open-tournament/&item_name=GCC Open Tournament&email=’+jQuery(‘#email’).val()+’&first_name=’+jQuery(‘#fname’).val()+’&last_name=’+jQuery(‘#lname’).val()+’ ‘;} else {location = ‘https://www.paypal.com/?cmd=_xclick&business=greensborochessclub@gmail.com¤cy_code=USD&amount=’+jQuery(‘#Tournamount’).val()+’&return=http://www.greensborochess.org/thank-you-for-your-participation/&rm=2&cancel_return=http://www.greensborochess.org/cancellation-of-g-c-c-open-tournament/&item_name=GCC Open Tournament&email=’+jQuery(‘#email’).val()+’&first_name=’+jQuery(‘#fname’).val()+’&last_name=’+jQuery(‘#lname’).val()+’ ‘;}”
Many Thanks
Jacob