IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Validators and javascript

    Posted Mon June 25, 2012 07:30 AM

    Hi,

    I have a text input control with a regex validator. How can I check, on the client side (javascript), if the input set by the user is valid?

    Thanks
    Bruno


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: Validators and javascript

    Posted Mon June 25, 2012 02:17 PM

    Your regex validator should run automatically (on the client side) whenever a command control is triggered.

    If you want to run the validation manually from a script, you could use the validate method from the CAF model.

    See:
    http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_sp2/My_webMethods/8-2-SP1_CAF_JavaScript_Reference/CAF.Input.Model.html#validate

    For example, something like this in a script block control:

    var m = CAF.model('#{caf:cid("input_control_id_here")}');
    var msg = m.validate(true);
    if (msg == "") {
    //input was valid
    } else {
    //input was not valid.  the msg variable contains the reason.
    }

    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 3.  RE: Validators and javascript

    Posted Thu January 17, 2013 11:55 AM

    Hi,

    But how can I show the custom message error under the control ?
    exp :
    my form contains a text-input, text-area and a dropdown and i wanna check if the 2 first controls are not empty and if the dropdown value respect a format, just with using javascript validation and show the custom msg error under every control?

    Thanks and regards


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 4.  RE: Validators and javascript

    Posted Tue November 26, 2013 09:06 AM

    Other than some regex ninjitsu, e.g.

    (?!Not Specified).*

    is it possible to say NOT EQUALS in validation? This is useful for dropdowns and probably other things (placeholder text in inputs?).


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine