We help IT Professionals succeed at work.

how can i send two parameters in a script?

fedkris
fedkris asked
on
125 Views
Last Modified: 2014-09-13
we have a form, (see file attached), when i select a box, the radio button "yes" should be selected by script

<SCRIPT>
function GETONcheck(i)
{
document.getElementById(i).checked = true;

}
</SCRIPT>

Open in new window



 	<INPUT id=radio8 type=radio name=q17 value="1" <% if fq17 = "1" then response.write "checked" end if  %> >
  				<%=q20%>&nbsp;</td>
			   	<td>
				</td>
		   	</tr>
			 <tr>
			   	<td style="height: 21px">
			   	<INPUT id=radio9 type=radio name=q17 value="2" <% if fq17 = "2" then response.write "checked" end if  %>>
			   	<%=q21 %>&nbsp;</td>
			   	<td style="height: 21px"></td>
	   		 </tr>

	   		 
	   		 
		   	
			   		 
			   		 
			   		 
					 <tr>
					
			   	<td>
			   	<table cellpadding="0" cellspacing="0" style="width: 100%">
					<tr>
						<td width="25px">&nbsp;</td>
						<td><INPUT id=q18 type=checkbox name=q18 onchange="GETONcheck('q17')"  <%if request.querystring("fq18") = "on" then response.write "checked" end if  %>>&nbsp;<%=q30 %></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td><INPUT id=q19 type=checkbox name=q19 onchange="GETONcheck('q17')" <%if request.querystring("fq19") = "on" then response.write "checked" end if  %>>&nbsp;<%=q31 %></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td><INPUT id=q20 type=checkbox name=q20 onchange="GETONcheck('q17')" <%if request.querystring("fq20") = "on" then response.write "checked" end if  %>>&nbsp;<%=q32 %></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
				</table>

Open in new window




so, if i check box 18, 19 or 20, radiobutton 17 has to be checked, with value 2 (in this case, true).

you know how to do that?
B--script.png
Comment
Watch Question

Luis PérezSoftware Architect in .Net
CERTIFIED EXPERT

Commented:
Replace your
onchange="GETONcheck('q17')"
with
onchange="GETONcheck('radio9')"

Because inside GETONcheck you use GetElementById, the Id of the radiobutton is "radio9", not "q17".

Hope that helps.

Author

Commented:
hi, thx for answer, when i change that, he doesn't check the checkbox (yes)...
Luis PérezSoftware Architect in .Net
CERTIFIED EXPERT

Commented:
Have you changed it in all your checkboxes (three of them)?

Author

Commented:
yes, but it doesn"t work
Luis PérezSoftware Architect in .Net
CERTIFIED EXPERT

Commented:
Can you post your actual code (with changes inserted)?
Owner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Expert of the Year 2014
Top Expert 2014

Commented:
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
RobOwner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015

Commented:
Fully working demo in my comment

http:#a40243127

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.