David Megnin
asked on
How to copy contents of one text box to another text box inside a FormView if CheckBox is checked using JavaScript
Inside <asp:FormView ID="FormView1" FormView1, in the <EditItemTemplate>
I have two TextBoxes:
<table><td><asp:TextBox ID="SSNTextBox" runat="server" Text='<%# Bind("SSN") %>'/>
... and ...
<asp:TextBox ID="VerifySSN" runat="server" Text="" />
Also in the EditItemTemplate there's a CheckBox:
<asp:CheckBox ID="cbVerify" runat="server" Checked='<%# Bind("Verify") %>' />
When the page loads, if the CheckBox is checked I need to put the contents of TextBox "SSNTextBox" into TextBox "VerifySSN" with JavaScript
Please show me how to do that. Thank you!!!
I have two TextBoxes:
<table><td><asp:TextBox ID="SSNTextBox" runat="server" Text='<%# Bind("SSN") %>'/>
... and ...
<asp:TextBox ID="VerifySSN" runat="server" Text="" />
Also in the EditItemTemplate there's a CheckBox:
<asp:CheckBox ID="cbVerify" runat="server" Checked='<%# Bind("Verify") %>' />
When the page loads, if the CheckBox is checked I need to put the contents of TextBox "SSNTextBox" into TextBox "VerifySSN" with JavaScript
Please show me how to do that. Thank you!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh, I don't want the text copied from one textbox to the other WHEN the checkbox is checked. I only want to TEST the checkbox on PageLoad, and IF it is checked copy the contents of the first textbox to the second text box. If the check box is not checked I don't want to do anything.
I coud do it about like this in VB, but I want to do it client side.
On PageLoad
If cbVerify.Checked = true Then
VerifySSN.Text = SSNTextBox.Text
End If
Thanks.
I coud do it about like this in VB, but I want to do it client side.
On PageLoad
If cbVerify.Checked = true Then
VerifySSN.Text = SSNTextBox.Text
End If
Thanks.
ASKER