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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can onclick and window.onload be used to fire same event?

Status
Not open for further replies.

uncleroydee

Technical User
Nov 28, 2000
79
US
I have an array of three radio buttons that are selected based on whether all, some, or none of an array of checkboxes on the same page are checked. I adapted that page from one named "Checkmate" sent me by a friend named David Elderbrock. Checkmate uses an onclick event handler to toggle through the radio buttons and I would like to add the window.onLoad event to the same script so that the appropriate radio button will be checked based on values written to the checkboxes from a recordset (window.onLoad).

Can it be done? Can I have it both ways? If so, will someone let me know how?

Thanks
 
Just stick whatever code you want to fire onLoad (presumably the same one that fires w/ onClick ) in your body tag --

<body onLoad=&quot;theFunction(args);&quot;>

:)
Paul Prewett
 
Paul,
That worked perfectly. Thanks.

Now, do you know how I can set a checkbox value to checked using onClick or another event handler when a user writes into a textbox? I have one textbox (comments) on the form with the checkboxes and radio buttons and I'm hoping I can set the value of the checkbox automatically which, in turn, will check the correct radio button.

Thanks again for the help with the first problem.

Roy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top