Title: jquery val
Last modified: January 10, 2018

---

# jquery val

 *  Resolved [malpica](https://wordpress.org/support/users/malpica/)
 * (@malpica)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/jquery-val/)
 * Hi,
    I have a problem with one formula: I have two buttons and one number field.
   I need that when I click in one button the number field is automatically populated
   with value of another calculated field, and the same with when I click the other
   button, but if the user want can populate number field manually. I have inserted
   this script in one html field, but when I click in button don’t populate number
   field. <script> jQuery(document).on(‘click’, ‘[id*=”fieldname25_”]’, function(){
   var bmin= jQuery(‘[id*=”fieldname41_”]’).val()*1; jQuery(‘[id*=”fieldname27_”]’).
   val(bmin).change(); }); jQuery(document).on(‘click’, ‘[id*=”fieldname26_”]’, 
   function(){ var bmax= jQuery(‘[id*=”fieldname42_”]’).val(); jQuery(‘[id*=”fieldname27_”]’).
   val(bmax).change(); }); </script>
 * fieldname25 and fieldname26 are a button
    fieldname41 and fieldmane42 are calculated
   fields fieldname27 is a number field
 * Best regards

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/jquery-val/#post-9852426)
 * Hello,
 * Please, include the link to the webpage where the form is inserted, I need check
   the code running.
 * Best regards.
 *  Thread Starter [malpica](https://wordpress.org/support/users/malpica/)
 * (@malpica)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/jquery-val/#post-9852749)
 * [http://www.test.mendivilyasociados.com/](http://www.test.mendivilyasociados.com/)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/jquery-val/#post-9852944)
 * Hello,
 * The issue is simple, you have defined the fieldname27 field as a number field
   with the dot (.) as decimal separator, but the calculated field uses the comma
   symbol (,) as decimal separator, so, when you try to assign the value of calculated
   field to the number field, won’t be possible because it is not a valid number.
 * Best regards.

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

The topic ‘jquery val’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/jquery-val/#post-9852944)
 * Status: resolved