Title: Having Trouble with Javascript and Smart Forms
Last modified: August 22, 2016

---

# Having Trouble with Javascript and Smart Forms

 *  [dunedon](https://wordpress.org/support/users/dunedon/)
 * (@dunedon)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/having-trouble-with-javascript-and-smart-forms/)
 * For the life of me I can’t figure out why I’m unable to update a field value 
   before submitting the form. Although my Javascript validates I am unable to see
   the changed field value in the entries screen. I’m sure it’s something simple
   but if you could please review and tell me what I’m doing wrong (or where to 
   look for an answer) it would be much appreciated:
 *     ```
       BeforeFormSubmit:function(formData,jQueryFormReference){
           //Here you can put code that you want to be executed before the form is submitted
         var vEmailto = jQuery('#rnField10');
         var vPickvalue = jQuery('#rnField3');
   
          switch (vPickvalue.val()) {
             case 1: vEmailto.val("email@site.com"); break;
             case 2: vEmailto.val("email2@site.com"); break;
             default: vEmailto.val("email3@site.com");
          }
       }
       ```
   
 * [https://wordpress.org/plugins/smart-forms/](https://wordpress.org/plugins/smart-forms/)

The topic ‘Having Trouble with Javascript and Smart Forms’ is closed to new replies.

 * ![](https://ps.w.org/smart-forms/assets/icon-256x256.jpg?rev=1226707)
 * [Smart Forms - when you need more than just a contact form](https://wordpress.org/plugins/smart-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-forms/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [dunedon](https://wordpress.org/support/users/dunedon/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/having-trouble-with-javascript-and-smart-forms/)
 * Status: not resolved