Simple verification using JavaScript scripts

Source: Internet
Author: User

today, I encountered a small problem on the book management page of the book purchasing network. About user input verification: Use. the verification control of net can implement more user input verification, but the prompt information output is not very flexible, so try to Display Error information with Div mark in a conspicuous place on the page. the page form contains three textbox controls and one imagebutton control. The javascript Code is as follows:
the master page is used, in the environment edited by vs2005, the Control ID is not a real ID. After the output is HTML code, some characters are automatically added before the ID, therefore, you need to copy the Control ID in the browser to obtain the real control id

the CS file code on the page is as follows:
protected void page_load (Object sender, eventargs e)
{< br> textbox1.attributes. add ("onblur", "Return check ('" + textbox1.clientid + "', 'author is blank! '); ");
textbox2.attributes. Add (" onblur "," Return check (' "+ textbox2.clientid +" ', 'The title is blank! '); ");
textbox3.attributes. Add (" onblur "," Return check (' "+ textbox3.clientid +" ',' press is blank! '); ");
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.