DROPDOWNLIST can be entered, selectable

xiaoxiao2021-03-06  38

When making a drop-down frame, you will usually be required to enter or choose. It has also found the easy-to-use controls on the Internet, but many are required to register, or install, and all Chinese: (the method used here is not Using other controls, and the code is very small, the main idea is to block the drop-down box in addition to the button part, put the server-side TextBox uses the absolute position to put the part to the shielded part, assign the value to TextBox This can reach the drop-down box that can be entered and selectable. The following is the specific code of this method is divided into three parts, the first part is the JavaScript script written; the second part is .html setting; Part III; For background code, add JavaScript's event Function Addtxttanto (VA) {document.all ("txttitle"). Value = VA; // Select the value selected in DDL Document.all ("txttitle"). SELECT (); // Skip DDL to the selected value} Function checktitle () {// Check the input text in the DDL in the DDL does have var DRP = Document.all ("ddltitle"); // Define DDL VAR T = Document.all ("txttitle"); // Defines TextBox VAR J = 0; // Count IF (T.Value == ") {} else {for (VAR i = 0; i

<

Div

ID = "SELDIV"

Style = "Z-Index: 100; Left: 48px; Visibility: Visible; Clip: Rect (0px 110px 80px 92px); Position: Absolute; Top: 26px>>

<

ASP

: DROPDOWNLIST

ID = "ddltitle"

Style = "z-index: -1"

Runa

T = "server"

Width = "110">

ASP: DropDownList>

<

ASP: TEXTBOX

ID = "txttitle"

Style = "Z-Index: 103; Left: 47px; Position: absolute; top: 26px"

Runat = "server"

FONT-

SIZE = "10"

Width = "111"

Maxlength = "50"

HEIGHT = "22">

<

/ ASP: TEXTBOX>

Private Sub Page_Load (Byvale AS System.Object, Byval E AS System.Eventargs) Handles MyBase.Load

TXTTITLE.Attributes ("onblur") = "JavaScript: Checktitle ();"

DDLTITE.Attributes.add ("onchange", "" THIS.Options [this.selectedIndex] .innertext) ")

End Sub

转载请注明原文地址:https://www.9cbs.com/read-67422.html

New Post(0)