开发者

Problem in Displaying error message in jquery

开发者 https://www.devze.com 2022-12-20 19:41 出处:网络
I have a form which have five text boxes. I have applied custom validation using validate.addmethod to 4 textboxes out of above 5 textboxes.

I have a form which have five text boxes. I have applied custom validation using validate.addmethod to 4 textboxes out of above 5 textboxes. The validation is applied to first three text boxes, the fourth textbox dont have any validation, the last text box have the same validation as first three text box. The Validation is working perfect but there is a problem with error message display. The problem is when user enters invalid data in third text box a error message is get displayed for that textbox.and if user continues to enter data further that is keeping invalid data in third text box and continues entering data in fourth text box for which validation is not applied the error message of third text box开发者_JAVA技巧 is remain as it is but as soon as cursor goes to fifth text box the error message of third text box goes off in-spite of the wrong data in that text box. Here I dont understand whats goes wrong there. Please help me to solve this problem Thank You!


Are you using the same field identifier aka field error name for text box 3 and text box 5 for showing errors? It may be happening that since same validation applies to text 3 and 5 , a mixup of the action fields is happening leading to the previous message getting cleared.

Try if the same happens when invalid data is fed to text 1 and then you come to text 2 or 3.

Also , adding a sample code snippet would help in decoding you problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消