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 6474069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:32:35+00:00 2026-05-25T06:32:35+00:00

In my jsp when i select one option in the dropdown it works fine

  • 0

In my jsp when i select one option in the dropdown it works fine with visibilty toggle but when i try it out for second time on it doesnot work

my jsp :

<html>
    <head>
    <script src="javascript/display_toggle.js" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>IDOC AUTHORING TOOL</title>
    </head>
    <body>

    <div id="BasePage"  style="display:block;" >
    <p>
    <u> </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
    <p></p>
    <p>Enter/Choose ailment :
    <select  size="1">
    <option>Malaria</option>
    <option>High Fever</option>
    <option>Cholera</option>
    </select></p>
    <p>Choose Authoring Mode :
    <select size="1" name="AuthoringOption" id ="AuthoringOption" onchange="javascript:display_toggle()">
    <option selected="selected"> </option>
    <option value ="1">Input Desicion Tree</option>
    <option value ="2">Input Prevention</option>
    <option value ="3">Input Symptoms</option>
    <option value ="4">Input Prescription</option>
    </select></p>
    <fieldset style="width: 381px; height: 126px; padding: 2">
        <legend align="left"></legend>
     Tick off patient context :
        <input type="radio" value="V1" checked name="R1">Men
        <input type="radio" name="R1" value="V2">Women
        <p>
        <input type="radio" name="R1" value="V3"> Child
        <input type="radio" name="R1" value="V4"> All</p>
        </fieldset>
    <p>Enter Pre Conditions</p>
    <p><textarea rows="2" cols="20"></textarea> 
    </div> 


    <!-- ______________________________________________________________________________________________________- -->


    <div id="Symptoms" style="display:none;">
    <html:form method="POST" action="symptoms"  >
    <!-- --- -->    
    <p>
    <u> </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
    <p></p>
    <p>Enter/Choose ailment :
    <html:select name="AuthoringForm" property="disease_name" size="1">
    <option>Malaria</option>
    <option>High Fever</option>
    <option>Cholera</option>
    </html:select></p>
    <p>Choose Authoring Mode :
    <select size="1" name="AuthoringOption" id ="AuthoringOption" onChange="javascript:display_toggle()">
    <option selected="selected"> </option>
    <option value ="1">Input Desicion Tree</option>
    <option value ="2">Input Prevention</option>
    <option value ="3">Input Symptoms</option>
    <option value ="4">Input Prescription</option>
    </select></p>
    <fieldset style="width: 381px; height: 126px; padding: 2">
    <legend align="left"></legend>
     Tick off patient context :
    <html:radio value="Men" name="AuthoringForm" property="patient_context" disabled="false"/>Men 
    <html:radio value="Womwen" name="AuthoringForm" property="patient_context" disabled="false"/>Women
    <p>
    <html:radio value="Child" name="AuthoringForm" property="patient_context" disabled="false"/>Child
    <html:radio value="Al" name="AuthoringForm" property="patient_context" disabled="false"/>All
    </fieldset>
    <p>Enter Pre Conditions</p>
    <p><html:textarea rows="2" name="AuthoringForm" cols="20" property="patient_precondition" ></html:textarea>
    <p>Must Have Symptoms : 
    May Have Symptoms :</p>
    <p><html:textarea rows="2" name="AuthoringForm" cols="20" property="must_have_symptoms"></html:textarea>
    <!-- <input type="submit" value="Submit" name="B2">-->
    <html:textarea rows="2" name="AuthoringForm" cols="20" property="may_have_symptoms"></html:textarea>
    <input type="submit" value="Submit" name="symptomsButton"><input type="reset" value="Reset" onclick="this.form.reset()"></p>
    </html:form>
    </div>

    <!--___________________________________________________________________________________________ -->
    <div id="Prevention" style="display:none;">
    <html:form  method="POST" action="prevention"  >

    <!-- ---------------------------------- --> 
    <p>
    <u> </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
    <p></p>
    <p>Enter/Choose ailment :
    <html:select name="AuthoringForm" property="disease_name" size="1">
    <option>Malaria</option>
    <option>High Fever</option>
    <option>Cholera</option>
    </html:select></p>

    <p>Choose Authoring Mode :
    <select size="1" name="AuthoringOption" id ="AuthoringOption" onChange="javascript:display_toggle()">
    <option selected="selected"> </option>
    <option value ="1">Input Desicion Tree</option>
    <option value ="2">Input Prevention</option>
    <option value ="3">Input Symptoms</option>
    <option value ="4">Input Prescription</option>
    </select></p>

        <fieldset style="width: 381px; height: 126px; padding: 2">
        <legend align="left"></legend>
         Tick off patient context :
        <html:radio value="Men" name="AuthoringForm" property="patient_context" disabled="false"/>Men 
        <html:radio value="Womwen" name="AuthoringForm" property="patient_context" disabled="false"/>Women
        <p>
        <html:radio value="Child" name="AuthoringForm" property="patient_context" disabled="false"/>Child
        <html:radio value="Al" name="AuthoringForm" property="patient_context" disabled="false"/>All
        </fieldset>

    <p>Enter Pre Conditions</p>

        <p><html:textarea rows="2" name="AuthoringForm" cols="20" property="patient_precondition" ></html:textarea>


    <!-- --------------------------------------------------- -->   


        <p>Input for Prevention :
        </p>
        <p><html:textarea rows="8" name="AuthoringForm" cols="79" property="prevention"></html:textarea>
        <input type="submit" value="Submit" name="preventionButton"><input type="reset" value="Reset" onclick="this.form.reset()">
        </p>
    </html:form>
    </div>


    <!--____________________________________________________________________________________________ -->




    <div id="decisiontree" style="display:none;">

    <html:form method="POST" action="decisiontree" >
    <!-- ------------------------------------------------ -->
    <p>
    <u> </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
    <p></p>
    <p>Enter/Choose ailment :
    <html:select name="AuthoringForm" property="disease_name" size="1">
    <option>Malaria</option>
    <option>High Fever</option>
    <option>Cholera</option>
    </html:select></p>

    <p>Choose Authoring Mode :
    <select size="1" name="AuthoringOption" id ="AuthoringOption" onChange="javascript:display_toggle()">
    <option selected="selected"> </option>
    <option value ="1">Input Desicion Tree</option>
    <option value ="2">Input Prevention</option>
    <option value ="3">Input Symptoms</option>
    <option value ="4">Input Prescription</option>
    </select></p>

        <fieldset style="width: 381px; height: 126px; padding: 2">
        <legend align="left"></legend>
         Tick off patient context :
        <html:radio value="Men" name="AuthoringForm" property="patient_context" disabled="false"/>Men 
        <html:radio value="Womwen" name="AuthoringForm" property="patient_context" disabled="false"/>Women
        <p>
        <html:radio value="Child" name="AuthoringForm" property="patient_context" disabled="false"/>Child
        <html:radio value="Al" name="AuthoringForm" property="patient_context" disabled="false"/>All
        </fieldset>

    <p>Enter Pre Conditions</p>
    <p><html:textarea rows="2" name="AuthoringForm" cols="20" property="patient_precondition" ></html:textarea>

    <!-- ------------------------------------------------ -->

        <p>
        </p>
        <fieldset style="width: 1225px; height: 451px; padding: 2">
        <legend>Decision Tree Preview </legend>

    <applet code="com.vaannila.utility.dynamicTreeApplet.class" archive="./appletjars/dynamictree.jar, ./appletjars/prefuse.jar" width ="1000" height="500">
    </applet>
    </fieldset><p>

        </p>
        <p>Enter Follow Up Questions :</p>

        <html:textarea rows="4" name="AuthoringForm" cols="45" property="follow_up_questions" ></html:textarea>
        <html:radio value="Yes" name="AuthoringForm" property="followupconsent" disabled="false"/> Yes
        <html:radio  value="No" name="AuthoringForm" property="followupconsent" disabled="false"/> No
        <input type="submit" value="Submit" name="followupQuestionButton"><input type="reset" value="Reset" onclick="this.form.reset()"><p>
        </p>
    </html:form>
    </div>
    <!--  ______________________________________________________________________________________________________________________________-->

    <div id="Prescription" style="display:none;">
    <html:form  method="POST" action="prescription"  >

    <!-- ---------------------------------- --> 
    <p>
    <u> </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
    <p></p>
    <p>Enter/Choose ailment :
    <html:select name="AuthoringForm" property="disease_name" size="1">
    <option>Malaria</option>
    <option>High Fever</option>
    <option>Cholera</option>
    </html:select></p>

    <p>Choose Authoring Mode :
    <select size="1" name="AuthoringOption" id ="AuthoringOption" onChange="javascript:display_toggle()">
    <option selected="selected"> </option>
    <option value ="1">Input Desicion Tree</option>
    <option value ="2">Input Prevention</option>
    <option value ="3">Input Symptoms</option>
    <option value ="4">Input Prescription</option>
    </select></p>

        <fieldset style="width: 381px; height: 126px; padding: 2">
        <legend align="left"></legend>
         Tick off patient context :
        <html:radio value="Men" name="AuthoringForm" property="patient_context" disabled="false"/>Men 
        <html:radio value="Womwen" name="AuthoringForm" property="patient_context" disabled="false"/>Women
        <p>
        <html:radio value="Child" name="AuthoringForm" property="patient_context" disabled="false"/>Child
        <html:radio value="Al" name="AuthoringForm" property="patient_context" disabled="false"/>All
        </fieldset>

    <p>Enter Pre Conditions</p>

        <p><html:textarea rows="2" name="AuthoringForm" cols="20" property="patient_precondition" ></html:textarea>


    <!-- --------------------------------------------------- -->   


        <p>Input for Prescription :
        </p>
        <p><html:textarea rows="8" name="AuthoringForm" cols="79" property="prescrption"></html:textarea>
        <input type="submit" value="Submit" name="prescriptionButton" ><input type="reset" value="Reset" onclick="this.form.reset()">

        </p>
    </html:form>
    </div>
    </body>
    </html>

my javascript:

function display_toggle(){
var e=document.getElementById("AuthoringOption").value;
if (e=="1"){
document.getElementById("Symptoms").style.display="none";
document.getElementById("Prevention").style.display="none";
document.getElementById("decisiontree").style.display="block";
document.getElementById("BasePage").style.display="none";
document.getElementById("Prescription").style.display="none";
}
else if(e=="2"){
document.getElementById("Prevention").style.display="block";
document.getElementById("decisiontree").style.display="none";
document.getElementById("Symptoms").style.display="none";
document.getElementById("BasePage").style.display="none";
document.getElementById("Prescription").style.display="none";
}
else if(e=="3"){
document.getElementById("decisiontree").style.display="none";
document.getElementById("Symptoms").style.display="block";
document.getElementById("Prevention").style.display="none";
document.getElementById("BasePage").style.display="none";
document.getElementById("Prescription").style.display="none";
}
else if(e =="4"){
document.getElementById("decisiontree").style.display="none";
document.getElementById("Symptoms").style.display="none";
document.getElementById("Prevention").style.display="none";
document.getElementById("BasePage").style.display="none";
document.getElementById("Prescription").style.display="block";
}
}
  • 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-05-25T06:32:35+00:00Added an answer on May 25, 2026 at 6:32 am

    All of these &nbsp; make it extremely difficult to read your code. Can yo remove all the unnecessary stuff? Most likely, the first time you go through your JS, one of the lines produces an error. Many browsers disable JS on the page after an error is produced.

    I suggest you start by looking at the console to see if any JS errors are displayed.

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

Sidebar

Related Questions

I have two side-by-side DIVs in a JSP. It works well, with one exception:
I have a 5 drop-downs in my JSP page <select> <option></option> <option></option> <option></option> <option></option>
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
This is the value retrieved from database : <select id=approve name=approval> <option value=0>-- Please
I am getting one value by JSON array, but how can I store multiple
In my jsp page i have one text box and two combo box. An
I have a drop down in a jsp page having the following code <s:select
Sounds simple enough...but I've been plugging away at this, trying to find the one
I have a trinidad table with one column contains drop downs (select one choice)
I need to validate this simple pick list: <select name=<%= key %>> <option value=ETC

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.