jQWidgets Forums

jQuery UI Widgets Forums Editors NumberInput Input Validation

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 13 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Input Validation #984

    rafi
    Participant

    I have a new question regarding your NumberInput. I want to restrict the users input to only positive numbers. How can I achieve that?

    Input Validation #985

    Peter Stoev
    Keymaster

    Hi rafi,

    To restrict the input, use the min and max properties of the jqxNumberInput. The code example below initializes ‘min’ to 0.

    $("#numericInput").jqxNumberInput({ width: '250px', height: '25px', min: 0});

    And here’s how to set a ‘max’ value.

    $("#numericInput").jqxNumberInput({ width: '250px', height: '25px', max: 999});

    The jqxNumberInput will automatically display a Validation Error message if the user entered an invalid value ( not in the min-max range).

    Best Regards,
    Peter Stoev

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.