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.