Asp.net TextBox press ENTER trigger event image displayed in img

Source: Internet
Author: User

TextBox press ENTER trigger event
Copy codeThe Code is as follows:
// Directly write 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 event
Copy 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 Images
Copy 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.