Title: Validation before submit
Last modified: April 17, 2018

---

# Validation before submit

 *  Resolved [xaviern](https://wordpress.org/support/users/xaviern/)
 * (@xaviern)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/validation-before-submit/)
 * Hi.
    I am using this plugin to make a form (obviously) but I have a <select> 
   that requires <option value=”xxx”> because I have a script that when a person
   choose XXX option, another div is displayed, everything works but when I recieve
   the email, instead of recieving the text of the selected option I recieve the
   value of the option. Example: <select> <option value=”test”>A simple text</option
   > //script to display the div <div id=”test” display:none>TEXT</div>
 * What I recieve on the email is this
 * Chosen option: “Test”
 * What I really want is to change “Test” and insert “A simple text”

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

 *  Thread Starter [xaviern](https://wordpress.org/support/users/xaviern/)
 * (@xaviern)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/validation-before-submit/#post-10190092)
 * I also have some php code with some ifs that rename if option is test but where
   do I paste it?
 *  [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/validation-before-submit/#post-10190623)
 * So why not change the value to “A simple text” as well for the select option,
   if that’s what you want to be the value.
 * Hope that helps. If you have any questions, please let us know!
 *  Thread Starter [xaviern](https://wordpress.org/support/users/xaviern/)
 * (@xaviern)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/validation-before-submit/#post-10190634)
 * I already tried it but if I put spaces on value, my php to show/hide div display
   no longer works.
    This is my script for that:
 *     ```
       	$(function() {
               $('#colorselector').change(function(){
                   $('.colors').hide();
                   $('#' + $(this).val()).show();
               });
           });
       ```
   
    -  This reply was modified 8 years, 1 month ago by [xaviern](https://wordpress.org/support/users/xaviern/).
 *  [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/validation-before-submit/#post-10192685)
 * How about just adding the ID to the script directly, instead of using the value?
 * $(function() {
    $(‘#colorselector’).change(function(){ $(‘.colors’).hide(); $(‘#
   test’).show(); }); });
 * This way it does not depend on the value of the other field.
 * I can’t go too far in providing support on custom code like this as these comes
   down more to Jquery questions than questions specific to our plugin, I hope you
   understand.
 * Hope that helps. If you have any questions, please let us know!

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

The topic ‘Validation before submit’ is closed to new replies.

 * ![](https://ps.w.org/html-forms/assets/icon-256x256.png?rev=1754345)
 * [HTML Forms - Simple WordPress Forms Plugin](https://wordpress.org/plugins/html-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/html-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/html-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/html-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/html-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/html-forms/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/validation-before-submit/#post-10192685)
 * Status: resolved