Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    If the field with the price is included in the form, then, it has assigned a name following the standard of the plugin, for example: fielname1, and in this case the equation would be as simple as:

    fieldname1

    But if the field with the price is out of the form, the equation will depend of the field’s data. For example, I will assume that the field has defined the word “price” as the id attribute, in this case the equation could any of following:

    jQuery(‘#price’).val()

    Or

    document.getElementById(‘price’).value

    Best regards.

    Thread Starter Muhammad Sikander nasar

    (@muhammad-sikander-nasar)

    This is my my code that I am going to try.But the calculated form field do not get that price.

    <script type="text/javascript">
    
    	jQuery(document).ready(function(){
             var price = jQuery('#pro_price').val();// this val is 9560
    	       jQuery( '#fieldname25_1').val( price ); unable to assign that value to the calculated form field.I have given id of calculated form field .
    
    	});
      </script>
    Thread Starter Muhammad Sikander nasar

    (@muhammad-sikander-nasar)

    I have also assign class to the field But unable to get the price value.

    I have given class like this.

    <script type="text/javascript">
    
    	jQuery(document).ready(function(){
    
    		var price = jQuery('#pro_price').val();		
    
    			jQuery( '.price_cal input').val( price );
    
    	});
    </script>
    Plugin Author codepeople

    (@codepeople)

    Hi,

    You are trying to assign the value, before be sure the fields of forms have been created, please, follow the steps below:

    1. Remove your current code.

    2. Select the calculated field in the form, and paste the following equation in the text area for entering the equations:

    (function(){
    var price_field = jQuery('#pro_price');
    return IF(price_field.length,price_field.val(), '');
    })()

    Tip: Remember, in javascript the code is case sensitive.

    Best regards.

    Thread Starter Muhammad Sikander nasar

    (@muhammad-sikander-nasar)

    Hi,

    Thanks.You save my lot of time.I am very happy with your quick response.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Need to assign the value of input field that are outside the calculated fields’ is closed to new replies.