Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically set checkbox values 1

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
I am buldiing an app in asp.net 2.0.

I have some checkboxes. I want to be able to use java script to change the value of one boxes by clicking another. I actually want to say if box one gets clicked and it is true then the other two boxes are false.

My Code

Code:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.CheckBox1.Attributes("onclick") = "javascript:document.forms[0]['CheckBox2'].checked = true;"
        Me.CheckBox1.Attributes("onclick") = "javascript:document.forms[0]['CheckBox3'].checked = true;"
    End Sub

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
[tt] Me.CheckBox1.Attributes("onclick") = "javascript:document.forms[0]['CheckBox2'].checked = [red]!this.checked[/red];"
Me.CheckBox1.Attributes("onclick") = "javascript:document.forms[0]['CheckBox3'].checked = [red]!this.checked[/red];"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top