jQWidgets Forums

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    jqxValidator Posts
  • jqxValidator #48992

    deepak_chaurasia
    Participant

    Hi Team,
    in jqxValidator for input i want to give dynamic id rather than using ‘#ID’ , and we are making Single Page Application so id will be with respect to context ex:this.$rootDiv.find(this.selectorConstants.txtOriginalIssuePrice) , but since it takes only #ID , i am not able to set context. Please suggest any solution.

    jqxValidator #49063

    Dimitar
    Participant

    Hello deepak_chaurasia,

    You can pass a variable to the input property, provided that its value is a valid id, e.g.:

    var inputId = 'userInput';
    
    $('#testForm').jqxValidator({
        rules: [
                { input: '#' + inputId, message: 'Username is required!', action: 'keyup, blur', rule: 'required' },
    ...

    Instead of having a fixed value, your variable can get its value dynamically.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.