I have developed the following form:


If the user clicks on Setup Rider Units button without filling the editbox I will get the following screen:




After the user types a letter or space on the Client Name input box I will get following screen:


i.e the validation message is invisible when the user types a letter or presses space. I have used the following jquery onkeypress of the input box:

function Hide_Validation_Msg(id)

{

$("#"+id.id).removeClass('Not_Valid');

$("#ValidationMessage_"+id.id).css("display","none");

}


but if it is a fresh load and user types a space or  1 or 2 charactersand clicks the Setup Rider Units button then validation message doesnot get displayed as the jquery has already been fired. Please look at the screenshots below:



Please help me how can I show my validation message again instead of firing the jquery onPress.


Regards,

Manthan Shah.

Hello Manthan!

Just trying to make sure I understand the goal here. On a fresh load, if the user types in something as the client name and then clicks Setup Rider Units, wouldn't the client name be valid?  Or are you running additional validations and those are what are failing to display the message?

Also, just a point on your Hide_Validation_Msg.  If you are doing it onkeypress, what if the user presses backspace and just clears the data?  You might want to add an if condition against the value in the textbox before deciding to hide the error.

Hi,

I am running additional validation which is being displayed in validation message.

For the second part the Hide_Validation_Msg will run on button click.

Regards,

Manthan Shah.