August 15th, 2005, 01:54 PM
Checkbox activates another field in a GUI???
My question is probably pretty simple for you guys (and gals)
Anyhow I am in a dreamweaver environment using asp.net and vb.net. I have built a GUI that hase several different areas for a user to input information on of the fields is a checkbox. I would like it when the user checks the checkbox it activates another field which is a textbox and requires the user to input initials to be able to submit the form. How would I go about doing this? Thanks in advance
August 15th, 2005, 02:07 PM
what do you mean by activates? makes it visible or just makes it enabled to accept user input?
Making it enabled
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Page.IsPostBack Then
TextBox1.Enabled = CheckBox1.Checked
August 15th, 2005, 02:17 PM
Sorry I did mean enables for input because it is already visible or would you suggest doing it differently?
August 15th, 2005, 02:23 PM
What I posted should work fine then.
Comments on this post
August 15th, 2005, 02:28 PM
August 23rd, 2005, 01:39 PM
How do you make this a required field?
August 23rd, 2005, 03:04 PM
August 23rd, 2005, 03:07 PM
DUH I knew that. Sorry I guess I just had a small brain fart
Thank you for your help
October 9th, 2012, 09:04 AM
or directly place aspx requiredfieldvalidator control like this way.
Name: <asp:TextBox id="name" runat="server" />
<asp:Button runat="server" Text="Submit" />
<asp:RequiredFieldValidator ControlToValidate="name" Text="The name field is required!" runat="server" />
November 14th, 2012, 12:43 PM
All of this explains how to make a field active and require an entry. But, first you have to make sure that the Checkbox caused the postback.