Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
271 views
in Technique[技术] by (71.8m points)

asp.net - validate empty textboxes before leaving the textbox

I am developing an asp web application and I have an online form, I can already prompt the users that the text box is empty after clicking the submit button, however I want to prompt the user that the textbox cannot be left blank..

for example last name, middle name, and first name, when I am on the last name field, and I went to the middle name field, the last name textbox was left empty, I want to prompt the users that the last name textbox was left empty, and when there is already value, the prompt will be removed,

also i want the textbox to be bordered red then resume to normal when there is value,, thanks for your answers

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are using MVC, then use data annotations or you can use any jquery validation library like http://www.position-relative.net/creation/formValidator/demos/demoValidators.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...