| |

VerySource

 Forgot password?
 Register
Search
View: 677|Reply: 3

Click the item on the listbox, and then add the selected content to the text box where the focus is in real time. . .

[Copy link]

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-14 20:00:02
| Show all posts |Read mode
It seems that only JavaScript can be used. . . Too complicated. . . Depressed. .
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-19 01:36:01
| Show all posts
It is possible to add to the Guangben box, but as soon as you click the listbox, the focus will be removed.
Reply

Use magic Report

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-1-19 09:36:02
| Show all posts
Or that is, when the focus is on the text box. Then the state of the text box changes, such as the color, and then the color of the text box is judged. If the color changes, the last focus is here. Click the listbox to add the content to the textbox. . .
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-19 10:27:01
| Show all posts
<FORM id = "Form1" method = "post" runat = "server">
Ranch
<ASP: LISTBOX
Ranch
SelectionMode = "Multiple" onclick = "javascript: GoListClick ();" id = "ListBox1" style = "Z-INDEX: 101; LEFT: 56px; POSITION: absolute; TOP: 64px" runat = "server"
Width = "128px" Height = "168px">
<ASP: LISTITEM Value = "1"> a </ ASP: LISTITEM>
<ASP: LISTITEM Value = "2"> b </ ASP: LISTITEM>
<ASP: LISTITEM Value = "3"> d </ ASP: LISTITEM>
<ASP: LISTITEM Value = "4"> c </ ASP: LISTITEM>
</ ASP: LISTBOX>
<ASP: TEXTBOX id = "TextBox1" onfocus = "document.curText = this" runat = "server"> </ ASP: TEXTBOX>
<ASP: TEXTBOX id = "TextBox2" onfocus = "document.curText = this" runat = "server"> </ ASP: TEXTBOX> </ FONT>
</ FORM>


<SCRIPT language = "javascript">
<!-
 function GoListClick ()
 {
var text = Form1.ListBox1.options [Form1.ListBox1.selectedIndex] .innerText;
Ranch
if (document.curText! = null)
{
document.curText.value = text;
}
Ranch
 }
//->
</ SCRIPT>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list