Title: Validating Submit Button
Last modified: August 22, 2016

---

# Validating Submit Button

 *  [johnja1](https://wordpress.org/support/users/johnja1/)
 * (@johnja1)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/validating-submit-button/)
 * Hey Guys,
 * I was just wondering if someone can help me out here. I have given the user to
   select one of the 2 submit button I have on my form. But I’m not sure how to 
   check which one the user selected. I use id for my submit button. Will it be 
   possible to validate using the id in my on_sent_ok code ? if so how can can I
   check it.
    my code is something like that
 * 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 {location ………..+”;} “
 * Please advice
    Many Thanks’ Jacob
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [johnja1](https://wordpress.org/support/users/johnja1/)
 * (@johnja1)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/validating-submit-button/#post-5581168)
 * hello Takayuki,
 * Can you help me out here ?
    there should be a way to use document.getElementById
   to check if the user has clicked on Submit button. All I want is to re-direct
   the user to a different web site.
 * Many thanks
    Jacob

Viewing 1 replies (of 1 total)

The topic ‘Validating Submit Button’ 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/)

 * 1 reply
 * 1 participant
 * Last reply from: [johnja1](https://wordpress.org/support/users/johnja1/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/validating-submit-button/#post-5581168)
 * Status: not resolved