autopostback not going to next field

T

Thomas Scheiderich

I have a screen that just takes a phone book entry. In the Cell Phone
question, it checks to see if the field has changed. If the field is
no, it disables the textbox and greys out the label. If the field is
yes, it enables the Cell Phone field.

The problem is that when it returns, it doesn't go to cell phone number
field, which I would expect that it would. Am I doing something wrong here?

****************************************************************
<%@Page Explicit="True" Language="VB" Debug="True" %>
<html>
<script runat="server">
Sub HaveCell_TextChanged(Sender As Object, E As EventArgs)
If HaveCell.Text <> "yes" Then
LabelCellPhone.Enabled = False
CellPhone.Enabled = False
CellPhone.ToolTip = "No Cell Phone"
Else
LabelCellPhone.Enabled = True
CellPhone.Enabled = True
CellPhone.ToolTip = "Please enter your cell phone number"
End If
End Sub
</script>
<body>
<h1>Add Phonebook Entry</h1>
<form runat="server">
<asp:label id="LabelName" text="Name"
runat="server"/><br>
<asp:textbox id="Name" runat="server"
tooltip="Please enter your name"
tabindex=10/><br>

<asp:label id="LabelHomePhone" text="Home Phone"
runat="server"/><br>
<asp:textbox id="HomePhone" runat="server"
tooltip="Please enter your home phone number"
tabindex=20/><br>

<asp:label id="LabelHaveCell"
text="Do you have a cell phone?"
runat="server"/><br>
<asp:textbox id="HaveCell" runat="server"
tooltip="Do you have a cell phone? Answer yes or no."
ontextchanged="HaveCell_TextChanged"
autopostback="true" tabindex=30/><br>

<asp:label id="LabelCellPhone" text="Cell Phone"
runat="server"/><br>
<asp:textbox id="CellPhone" runat="server"
tooltip="Please enter your cell phone number"
tabindex=40/><br>

</form>
</body>
</html>

***************************************************************

Thanks,

Tom.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top