[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Problem with radio button not checked in form

Posted on 2004-08-14
3
Medium Priority
?
317 Views
Last Modified: 2012-08-14
Hi All,
 When click on option 2,3,4 form changed but radio button not check.
Any help appreciated.

<html>
<head>

<script language="javascript">


function showHide(n) {
var eles = document.getElementsByTagName("div");
for(i=0;i<eles.length;i++) {
document.getElementById(eles[i].id).style.visibility="hidden";
}
for(i=0;i<eles.length;i++) {
if (eles[i].id==n) {
document.getElementById(n).style.visibility="visible";
}

}


}
</script>




<style type="text/css"><!--
#hotelbox { position: absolute; top: 16px; left: 16px; width: 100px; height: 100px; visibility: visible }
#customtripbox { position: absolute; top: 148px; left: 217px; width: 100px; height: 100px; visibility: hidden }
#carbox { position: absolute; top: 50px; left: 16px; width: 100px; height: 100px; visibility: hidden }
#lastmindealsbox { position: absolute; top: 60px; left: 20px; width: 100px; height: 100px; visibility: hidden }


-->
</style>
</head>

<body>
<div id="hotelbox">
This is hotelbox </div>
<div id="customtripbox">
This customtripbox </div>
<div id="carbox">
This is carbox </div>
<div id="lastmindealsbox">
This is lastmindealsbox </div>

<br><br><br><br><br><br><br><br><br><br>
<form>
<input type="radio" value="hotelbox" onClick="showHide('hotelbox');" checked >Option 1 </a><br>
<input type="radio" value="customtripbox" onClick="showHide('customtripbox');">Option 2 </a><br>
<input type="radio" value="carbox" onClick="showHide('carbox');">Option 3 </a><br>
<input type="radio" value="lastmindealsbox" onClick="showHide('lastmindealsbox');">Option 4 </a><br>

</form>
</body>
</html>
0
Comment
Question by:dl2y
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 2000 total points
ID: 11801489
Hi dl2y

You appear to be missing the name value for the radio buttons. Try using this code below instead...

<form>
<input type="radio" value="hotelbox" name="boxOptions" onClick="showHide('hotelbox');" checked >Option 1 </a><br>
<input type="radio" value="customtripbox" name="boxOptions" onClick="showHide('customtripbox');">Option 2 </a><br>
<input type="radio" value="carbox" name="boxOptions" onClick="showHide('carbox');">Option 3 </a><br>
<input type="radio" value="lastmindealsbox" name="boxOptions" onClick="showHide('lastmindealsbox');">Option 4 </a><br>

</form>

Regards

Scott
0
 

Author Comment

by:dl2y
ID: 11801789
Hi Scott,

It's working now. Thanks a lot

Regards,
0
 
LVL 15

Expert Comment

by:Colosseo
ID: 11801805
Hi dl2y

Np glad its working and thanks for the Grade

Regards

Scott
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question