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

    (@codepeople)

    Hi @alexdubbb,

    I don’t understand totally your question, but if you want limit the number entered by the user through a “Number” field, you should enter the minimum and/or maximum values allowed, through the attributes: MIN and MAX of the “Number” field. Please, look the screenshot in the following link:

    http://wordpress.dwbooster.com/customdownloads/2016-10-08/minmax.png

    If you want that the result of an equation does not be greater than a specific number use the “MIN” operation. For example, if the equation of a calculated field is: fieldname1+fieldname2, but you don’t want a result greater than 100, the equation should be modified as follows:

    MIN(fieldname1+fieldname2,100)

    Best regards.

    Thread Starter alexdubbb

    (@alexdubbb)

    Thank you for quick reply.

    If I can setting: MIN[fieldname2] and MAX[fieldname3] of the “Number” field,it meets my requirements.

    However valid input is the number in “Number” field.

    My Limit=fieldname2 / fieldname3. not number.

    Best Regards,

    Plugin Author codepeople

    (@codepeople)

    Hi,

    I’m sorry, but I don’t understand what are you needing.

    The attributes: MIN/MAX correspond to the number fields, and they determine the maximum and minimum values allowed in the number fields.

    However, I don’t understand what you mean with:

    …My Limit=fieldname2 / fieldname3. not number…

    Best regards.

    Thread Starter alexdubbb

    (@alexdubbb)

    If I can setting like this.
    https://gingadza.files.wordpress.com/2016/10/calculated-fields-form-limit1.jpg

    its better for us.but, it is impossible.

    Do you have any way to the other?

    Regards,

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Not really, that’s is not possible, because the values of fields: fieldname3 and fieldname4 can be empties at the moment to fill fieldname2. There is a possible solution, please, follow the steps below:

    – Select the fieldname2, and assign to it a custom class name, for example: my-field

    Note: the class names are assigned to the fields through the attribute: “Add Css Layout Keywords”

    – Insert a calculated field in the form with the following equation:

    (function(){
    jQuery('.my-field input').attr( 'min', fieldname3 ).attr('max',fieldname4);
    })()

    and that’s all, now the attributes: “min” and “max” in the number field are defined dynamically.

    Best regards.

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

The topic ‘Input numerical limit’ is closed to new replies.