Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8723177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:34:10+00:00 2026-06-13T07:34:10+00:00

This is what I have: <script type=text/javascript> function toggle(value){ if(value==’show’) { document.getElementById(‘busblock’).style.display=’block’; } else

  • 0

This is what I have:

<script type="text/javascript">
function toggle(value){
  if(value=='show') { document.getElementById('busblock').style.display='block'; }
               else { document.getElementById('busblock').style.display='none'; }
}
</script>

<script type="text/javascript">
 function toggle(value){
  if(value=='show') { document.getElementById('guyblock').style.display='block'; }
           else { document.getElementById('guyblock').style.display='none'; }
  }
</script>
</head>
<body>

<form action="http://qa.onlinelabtests.com/guestlist.php" method="post">
First Name: <input type="text" name="fname" /> <br />
Last Name: <input type="text" name="lname" /> <br />
E-mail: <input type="email" name="email" /> <br />
Gender: <br />
<input type="radio" name="gender" value="male" onclick="toggle('show');">&nbsp;&nbsp;Male <br />
<input type="radio" name="gender" value="female" onclick="toggle('hide');">&nbsp;&nbsp;Female <br />

<div id="guyblock" style="display:none">
Referred By
<select name="tke">
<option value="915">Cameron</option>
<option value="930">Edgar</option>
<option value="950">JD</option>
<option value="1010">Estaban</option>
</select>
</div>

<div>
Bus Transportation <br />
<input name="bus" type="radio" value="yes" onclick="toggle('show');"> &nbsp;&nbsp;Yes<br />
<input name="bus" type="radio" value="no" onclick="toggle('hide');">&nbsp;&nbsp;No<br />
</div>

<div id="busblock" style="display:none">
Bus Time
<select name="departtime">
<option value="915">9:15PM</option>
<option value="930">9:30PM</option>
<option value="950">9:50PM</option>
<option value="1010">10:10PM</option>
</select>
</div>

<input type="submit" value="Register" />
</form>

But only one at a time works (if both female and yes to bus is selected, it hides the first one)

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:34:11+00:00Added an answer on June 13, 2026 at 7:34 am

    You need two different function names, as declaring the second one will overwrite the first. Change the name to something more declarative (say, toggleGender) See my change here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: <script type=text/javascript> function js() { var getJs = document.getElementById(jogo); if
I have this code <html> <head> <script src=jquery-1.7.2.min.js type=text/javascript></script> <script src=jquery-ui-1.8.20.custom.min.js type=text/javascript></script> <script type
html embedded with javascript <html> <head> <title>Example</title> <script type =text/javascript> have I called this
I have this script $('head').append('<link rel=stylesheet href=css/file1.css type=text/css />'); $('head').append('<link rel=stylesheet href=css/jquery.jscrollpane.css type=text/css />');
I'm using jQuery Raty and I have the following script: <script type=text/javascript charset=utf-8 src={{
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have this sample page: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8> <title>Ajax Page</title> <script
at the moment i have this <div id=beau> <div> <input type=text id=lun name=lun size=24
I want to check the username availbilty so I have this code: <script type
I have made a code -- <?php header(Content-type: text/javascript); require_once('../php/config.php'); $domail_theme = $_GET['theme']; ?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.