Asp.net textbox press ENTER trigger event image displayed in IMG

Source: Internet
Author: User

Textbox press ENTER trigger event CopyCode The Code is as follows: // write directly in JS
<Script language = "JavaScript">
Function entertextbox ()
{
If (event. keycode = 13 & document. All ["textbox1"]. value! = "")
{
Event. keycode = 9;
Event. returnvalue = false;
Document. All ["textbox1"]. Click ();
}
}
</SCRIPT>
<Body onkeypress = "Return entertextbox ()">
// Textbox1 indicates the textbox ID on the page.
<Script language = "JavaScript">
Function entertextbox (button)
{
If (event. keycode = 13 & document. All ["textbox1"]. value! = "")
{
Event. keycode = 9;
Event. returnvalue = false;
Document. All [button]. Click ();
}
}
</SCRIPT>

In the pageload eventCopy codeThe Code is as follows: textbox1.attribute. Add ("onkeypress", "entertextbox ('button1 ')");

The image of the database is displayed on the IMG.
Assume that the image file name is stored in your database.
The path of your local image is image
You can use the following code:Copy codeThe Code is as follows:

Highlight ImagesCopy codeThe Code is as follows: <HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> untitled document </title>
</Head>

<Body>
<Script language = "JavaScript"> <! --
Function makevisible (cur, which ){
If (which = 0)
Cur. Filters. Alpha. Opacity = 70
Else
Cur. Filters. Alpha. Opacity = 100
}
</SCRIPT>

</Body>
</Html>

Related Article

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.