The drop-down list box can only choose, I want to choose to allow users to modify the selected content, how to implement editabl

xiaoxiao2021-03-06  42

The drop-down list box can only choose, I want to choose to allow users to modify the selected content, how to implement editable drop-down list box?

Borrowing flowers:

editable drop box / * Author: fason (A letter) Date: 2003-7-1 version: v1.0 Note: only for technical exchanges, For reprint please indicate the author and other relevant information. Thank you * / function combox (obj, select) {this.obj = objthis.name = select; this.select = document.getelementsByName (select) [0]; / * To convert pull box * /}

/ * Initialization Object * / Combox.Prototype.init = function () {var inputbox = "" Document.write (InputBox) with (this.select.style) {left = getl (this.select) TOP = Gett (this.select) Position = "absolute" CLIP = "THIS.Select.OffSetWidth " this.select.offsetheight "" (this.select.offsetwidth-18) ")" / * cutting down pull box * /} this.select .οchange = new function (this.obj ". Change ()") this.change ()} / * Initialization end * /

Object event definition ///combox.prototype.find=Function ()) When searching for the value of the input box, the pull-down box automatically positioned * / var inputbox = document.getElementsByname ("Combox _" this.name) [0 ] with (this.select) {for (i = 0; i

Combox.prototype.change = function () {/ * Defines the drop-down onchange event * / var inputbox = document.getlementsByname ("Combox _" this.name) [0] infutbox.value = this.Select.Options [this. Select.selectedIndIndex] .Text; with (InputBox) {select (); focus ()};} Object Event end ///

/ * Common positioning function (access control absolute coordinate) * / function get1 (e) {var l = E.Offsetleft; while (e = E.OffsetParent) L = E.Offsetleft; returnit l} function gett (e) {var T = E.OffSettop; while (e = e.offSetParent) T = E.OffSettop; Return T} / * End * /