How can I make the cursorready inside the lit Box?

A

Allen

--------------------------------------------------------------------------------

I have a list box ready to collect information from the users. I noticed
that; every time the users need to enter something they have to use the
mouse to set the cursor inside the box. How can I set the cursor ready
inside the list box so that the users do not have to use the mouse very time
they want to enter something?
empNumBox->Text = " ";
 
A

Andrew Morton

Allen said:
I have a list box ready to collect information from the users. I
noticed that; every time the users need to enter something they have
to use the mouse to set the cursor inside the box. How can I set the
cursor ready inside the list box so that the users do not have to use
the mouse very time they want to enter something?
empNumBox->Text = " ";

<script type="text/javascript">
//<![CDATA[
document.getElementById('<%=yourListBox.ClientId%>').focus();
//]]>
</script>

Or, IIRC, there is now something in the framework to do that too. Oh, 30
seconds later, here's the example from the help:
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
TextBox1.Focus()
End Sub

(Don't forget to set the tabindex for input elements.)

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top