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
Expand all | Collapse all

Client Side Validation using Custom Java Script

  • 1.  Client Side Validation using Custom Java Script

    Posted Wed February 25, 2009 05:33 PM

    Hello Friends,

    I want to do a simple client side validation using custom java script.

    I have a view with a text field and command button. I also have a output–>script block added to the view.

    My requirement is very simple as follows. On clicking the button, a java script function for ex: validate() should be called. This source code of the function should reside in “Script block”

    The function “validate()” should check whether or not the text field is empty. That it should return either true or false to the calling position in this case the command button. Then the java script code on “Onlick” should just " alert "the return value.

    Any ideas?


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


  • 2.  RE: Client Side Validation using Custom Java Script

    Posted Thu February 26, 2009 05:20 AM

    Hi Sivaraman,

    I believe you can achieve the functionality without script block also.

    In the command button onClick event(Client Side Validations)
    read the value from the textbox control and check the length then alert the user

    Javascript

    var pNo = CAF.model(‘#{activePageBean.clientIds[’‘]}’).getValue();

    if(pNo.length==0)
    {
    alert(“Please enter Passport / ID No”);
    return;
    }

    Regards,
    Sunil_N


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