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

Onclick a button to automatically fill a radio button

Status
Not open for further replies.

larryman

Programmer
Jun 16, 2000
63
US
I have a button that already have onclick event. Now i want to add another onclick event to same button to automatically fill a radio button in the same form.
I would appreciate any help.
The existing one is this

<INPUT TYPE=&quot;button&quot; NAME=&quot;Button1&quot; VALUE=&quot; Click here for multiple entries&quot;
onClick=&quot;window.open ('attachment.asp', 'newWin',
'scrollbars=no,status=yes,width=450,height=500')&quot;> Oysterbar ride to success. Keep Riding
 
place the window.open in a function first

seeing as you lose focus on a window.open event jsut place the auto fill function before the window.open function in the call event
<INPUT TYPE=&quot;button&quot; NAME=&quot;Button1&quot; VALUE=&quot; Click here for multiple entries&quot;
onClick=&quot;autofillfunction(); openwindowevent&quot;> _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924

 
Do this:

onClick=&quot;document.myform.myradiobutton.selected;window.open ('attachment.asp', 'newWin',
'scrollbars=no,status=yes,width=450,height=500')&quot;>
 
Placido,

I tried doing this but the button is not being checked on the form. Oysterbar ride to success. Keep Riding
 
sorry Larryman-

the correct one is:

document.myform.myradiobutton.checked=true
 
Thanks Placido

It worked perfectly. Oysterbar ride to success. Keep Riding
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top