Select <Html>
<Head>
<script language= "JavaScript" >
<!--
Define Select original value
var Oldvalue,oldtext;
Select the onkeydown event for the Drop-down box to modify the value of the Drop-down box
function Catch_keydown (SEL)
{
Switch (Event.keycode)
{
Case 13://Enter
Event.returnvalue = false;
Break
Case://esc Key
Sel.options[sel.selectedindex].text = OldText;
Sel.options[sel.selectedindex].value = OldValue;
Event.returnvalue = false;
Break
Case 8://Empty Bar once
var s = sel.options[sel.selectedindex].text;
s = s.substr (0,s.length-1);
if (Sel.options[sel.selectedindex].value==sel.options[sel.selectedindex].text)
{
Sel.options[sel.selectedindex].value=s;
Sel.options[sel.selectedindex].text=s;
}
Event.returnvalue = false;
Break
}
if (!event.returnvalue && sel.onchange)
Sel.onchange (SEL)
}
Select the onkeypress event for the Drop-down box to modify the value of the Drop-down box
function Catch_press (SEL) {
if (sel.selectedindex>=0) {
var s = sel.options[sel.selectedindex].text + String.fromCharCode (event.keycode);
if (Sel.options[sel.selectedindex].value==sel.options[sel.selectedindex].text)
{
Sel.options[sel.selectedindex].value=s;
Sel.options[sel.selectedindex].text=s;
}
Event.returnvalue = false;
if (!event.returnvalue && sel.onchange)
Sel.onchange (SEL)
}
}
Select the onfocus event of the Drop-down box to save the original value of the dropdown box
function Catch_focus (SEL) {
OldText = Sel.options[sel.selectedindex].value;
OldValue = Sel.options[sel.selectedindex].value;
}
Restores the currently selected value of the Select Drop-down list
function Loadselect (obj,value)
{
for (var i=0; i< obj.options.length; i++)
if (Obj.options[i].value = = value)
{
Obj.selectedindex = i;
Break
}
}
Select selection box prompts for selection when the mouse moves up
function Selmouseover (obj)
{
With (Document.all.div_hint)
{
innertext = Obj.options[obj.selectedindex].text;
if (Innertext.length > 0)
{
InnerText = "" + innertext + "";
Style.display = "block";
Style.left = Event.clientx + 16;
Style.top = Event.clienty;
}
}
}
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