I
am trying to do a simliar thing like this on Apex
http://yensdesign.com/tutorials/validateform/
The link above shows an example but it is not in apex.
Basically I want to validation a field as a user is typing and remove the error as soon as the field is correct.
I am using apex verion 4.0.
What I have done so far and it is not working as in I am not getting any error message even though I am trying to force an error.
On the page HTML headers and Body Attribute I have my css
`<style> #error{ margin-bottom: 20px; border: 1px solid #efefef; } #error ul{ list-style: square; padding: 5px; font-size: 11px; } #error ul li{ list-style-position: inside; line-height: 1.6em; } #error ul li strong{ color: #e46c6d; } #error.valid ul li strong{ color: #93d72e; } </style>`
and in javascript I have
`$(document).ready() { var name = $("#P1_TEST"); }; <script> function validateName(){ //if it's NOT valid if(p_t03.val().length < 4){ p_t03.addClass("error"); error_message("Must be than 3 letters!"); return false; } //if it's valid else{ p_t03.removeClass("error"); return true; } } </script> <script> p_t03.blur(validateName); p_t03.keyup(validateName); </script>`
Please note that p_t03 is the P1_TEST name. because on inspect element on chrome. `id="pP1_TEST" name=" p_t03"
On Item-> P1_TEST -> HTML Form Element Attributes. II have onblur="validateName();" which should check the jquery validation above.
This is my first time doing this on apex. I am too sure if I am doing the right way.
Please help. Thanks in advance