Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #101611
    Dark Beccio
    Member

    Hi,
    i made a smart-window with many textboxs inside,
    i tried something like this in javascript:
    if(validator.validate()) {
    window.close();
    }
    did not expect this to work but i need something similar to use as a condition.
    ty for u’r suggestions
     

    #101628
    Dark Beccio
    Member

    to clarify, i need this with smart.validator.
    $(‘#jqxValidator’).on(‘validationSuccess’, function (event) { // Some code here. });

    #101633
    yavordashew
    Member

    Hi Dark Beccion,
    The validate function returns true if all rules are valid you can use this to trigger a function when the validator validates.
    However if this doesn’t suit your needs you can set the type="custom" to the validation rule and to validationCallback property to call a custom function defined by you.
    If the above suggestions don’t suit your needs maybe you can add more context in order to be able to give you the best solution.

    
     function validationCallbackEvenNum(event) {
            console.log(event)
            const window = document.querySelector('smart-window')
            window.close()
        }
    const rules =[ { input: '#evenInput', message: 'Please enter an even one.', action: 'keyup, blur', type: 'custom', validationCallback: validationCallbackEvenNum },
     { input: '#evenInput', message: 'The even number must be between 20 and 50', action: 'keyup, blur', type: 'range', min: 20, max: 50 },
          ]

    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

    #101638
    Dark Beccio
    Member

    ty, problem solved!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.