Title: Additional Setting
Last modified: May 4, 2017

---

# Additional Setting

 *  [johnja1](https://wordpress.org/support/users/johnja1/)
 * (@johnja1)
 * [9 years ago](https://wordpress.org/support/topic/additional-setting/)
 * 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&#8217](http://www.greensborochess.org/thank-you-for-your-participation&#8217);)}
   else if (document.getElementById(‘RegPay’).value== “Register & Pay Later”) {location.
   replace(‘[http://www.greensborochess.org/thank-you-for-your-participation&#8217](http://www.greensborochess.org/thank-you-for-your-participation&#8217);)}
   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&currency_code=USD&amount=’+jQuery(‘#Tournamount&#8217](https://www.paypal.com/?cmd=_xclick&business=greensborochessclub@gmail.com&currency_code=USD&amount=’+jQuery(‘#Tournamount&#8217);).
   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&currency_code=USD&amount=’+jQuery(‘#Tournamount&#8217](https://www.paypal.com/?cmd=_xclick&business=greensborochessclub@gmail.com&currency_code=USD&amount=’+jQuery(‘#Tournamount&#8217);).
   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

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [9 years ago](https://wordpress.org/support/topic/additional-setting/#post-9099721)
 * See [DOM Events](https://contactform7.com/dom-events/)
 *  Thread Starter [johnja1](https://wordpress.org/support/users/johnja1/)
 * (@johnja1)
 * [9 years ago](https://wordpress.org/support/topic/additional-setting/#post-9102193)
 * Hi Takayuki,
 * Thank you for your reply. Just a few questions regarding the DOM events,
    a) 
   Can I replace these code in the additional setting tab where I had put the code
   for the Hook on_sent_ok:? b) Will the additional setting tab be discontinued 
   later? c) Where is the best place to validate inputs within our contact form ?
   please advice.
 * Many Thanks
    Jacob
 *  Thread Starter [johnja1](https://wordpress.org/support/users/johnja1/)
 * (@johnja1)
 * [9 years ago](https://wordpress.org/support/topic/additional-setting/#post-9114221)
 * Hi Takayuki,
 * Where can we put the DOM events code ? Please advice ? I’m not clear about you
   mentioning put in the Theme (header.php). can I put the in the form itself ?
 * Thanks
    Jacob
 *  Thread Starter [johnja1](https://wordpress.org/support/users/johnja1/)
 * (@johnja1)
 * [9 years ago](https://wordpress.org/support/topic/additional-setting/#post-9156385)
 * Hi Takayuki,
 * I’m still unable to use DOM events code as you recommended to reduce complexity
   I use the plugin Insert Headers and Footers to insert your code
    <script> document.
   addEventListener( ‘wpcf7mailsent’, function( event ) { location = ‘[http://example.com/&#8217](http://example.com/&#8217);;},
   false ); </script> Unfortunately it did not work. I use the default theme of 
   WordPress [http://www.greensborochess.org/test1/](http://www.greensborochess.org/test1/)
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [9 years ago](https://wordpress.org/support/topic/additional-setting/#post-9158030)
 * > I use the default theme of WordPress
 * No. At least it’s not unmodified Twenty Fourteen.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Additional Setting’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/additional-setting/#post-9158030)
 * Status: not resolved