html div 重新加载提交按钮的 onclick 并重新加载整个页面

发布于 2024-11-30 01:48:22 字数 24368 浏览 0 评论 0原文

我必须重新加载 div“decisiontree”,以便重新加载小程序以读取更新的 xml,而无需重新加载整个页面。

jsp代码:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> 
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> 
<%@taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %> 



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

<div id="BasePage"  style="display:block;" >

<Script language="JavaScript">
function ashu(){
$(document).ready(function() {
alert("jQuery tutorial for beginners Example");
});
}
</Script>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<u>&nbsp; </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
<p>&nbsp;</p>
<p>Enter/Choose ailment :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select  size="1"  onchange="javascript:ashu">
<option>Malaria</option>
<option>High Fever</option>
<option>Cholera</option>
</select></p>
<p>Choose Authoring Mode :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</select></p>
<fieldset style="width: 381px; height: 126px; padding: 2">
    <legend align="left">&nbsp;</legend>
&nbsp; Tick off patient context :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" value="V1" checked name="R1">Men&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="R1" value="V2">Women
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="R1" value="V3"> Child&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="R1" value="V4"> All</p>
    </fieldset>
<p>&nbsp;Enter Pre Conditions</p>
<p>&nbsp;<textarea rows="2" cols="20"></textarea>&nbsp;&nbsp; 
</div> 


<!--_______________________________________________________ -->

<script type ="text/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";
}
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";

}
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";

}
}
</script>

<div id="Symptoms" style="display:none;">
<html:form method="POST" action="symptoms" onreset="true">

<!-- --- -->    
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<u>&nbsp; </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
<p>&nbsp;</p>
<p>Enter/Choose ailment :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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 :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</select></p>
<fieldset style="width: 381px; height: 126px; padding: 2">
<legend align="left">&nbsp;</legend>
&nbsp; Tick off patient context :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:radio value="Men" name="AuthoringForm" property="patient_context" disabled="false"/>Men &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:radio value="Womwen" name="AuthoringForm" property="patient_context" disabled="false"/>Women
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:radio value="Child" name="AuthoringForm" property="patient_context" disabled="false"/>Child&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:radio value="Al" name="AuthoringForm" property="patient_context" disabled="false"/>All
</fieldset>
<p>&nbsp;Enter Pre Conditions</p>
<p>&nbsp;<html:textarea rows="2" name="AuthoringForm" cols="20" property="patient_precondition" ></html:textarea>&nbsp;&nbsp;


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

<p>&nbsp;Must Have Symptoms :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
May Have Symptoms :</p>
<p>&nbsp;<html:textarea rows="2" name="AuthoringForm" cols="20" property="must_have_symptoms"></html:textarea>&nbsp;&nbsp;
<!-- <input type="submit" value="Submit" name="B2">-->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:textarea rows="2" name="AuthoringForm" cols="20" property="may_have_symptoms"></html:textarea>&nbsp;&nbsp;&nbsp;
<input type="submit" value="Submit" name="symptomsButton"></p>
</html:form>
</div>

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

<!-- ---------------------------------- --> 
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<u>&nbsp; </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
<p>&nbsp;</p>
<p>Enter/Choose ailment :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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 :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</select></p>

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

<p>&nbsp;Enter Pre Conditions</p>

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


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


    <p>&nbsp;Input for Prevention&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </p>
    <p>&nbsp;<html:textarea rows="8" name="AuthoringForm" cols="79" property="prevention"></html:textarea>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" value="Submit" name="preventionButton">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </p>
</html:form>
</div>


<!--____________________________________________________________________________________________ -->




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

<html:form method="POST" action="decisiontreexml" >
<!-- ------------------------------------------------ -->
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<u>&nbsp; </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
<p>&nbsp;</p>
<p>Enter/Choose ailment :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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 :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</select></p>

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

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

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

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

<!-- <applet code="TreeViewApplet.class" codebase="C:/Users/ashutosh_k/idoc/docRuleTool/WebContent/WEB-INF/classes/com/vaannila/utility/" archive=" C:/Users/ashutosh_k/idoc/docRuleTool/WebContent/WEB-INF/lib/prefuse.jar" width="1000" height="500"  type="applet">-->
<form>
<applet code="com.vaannila.utility.dynamicTreeApplet.class" archive="./appletjars/dynamictree.jar, ./appletjars/prefuse.jar" width ="1000" height="500">
</applet>
</form>


<!--</applet>-->

</fieldset><p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </p>
    <p>Enter Follow Up Questions :</p>
<html:form method="POST" action="decisiontree">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <html:textarea rows="4" name="AuthoringForm" cols="45" property="follow_up_questions"></html:textarea>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <html:radio value="Yes" name="AuthoringForm" property="followupconsent" disabled="false"/> Yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <html:radio  value="No" name="AuthoringForm" property="followupconsent" disabled="false"/> No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" value="Submit" name="followupQuestionButton"><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </p>
</html:form>
</html:form>
</div>
</body> 

I have to relaod the div "decisiontree" so that the applet gets reloaded to read the updated xml without reloading the whole page .

jsp code :

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> 
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> 
<%@taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %> 



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

<div id="BasePage"  style="display:block;" >

<Script language="JavaScript">
function ashu(){
$(document).ready(function() {
alert("jQuery tutorial for beginners Example");
});
}
</Script>
<p>                                                                                
<u>  </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
<p> </p>
<p>Enter/Choose ailment :               
<select  size="1"  onchange="javascript:ashu">
<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>
</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> 


<!--_______________________________________________________ -->

<script type ="text/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";
}
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";

}
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";

}
}
</script>

<div id="Symptoms" style="display:none;">
<html:form method="POST" action="symptoms" onreset="true">

<!-- --- -->    
<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>
</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"></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>
</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">                                                         
    </p>
</html:form>
</div>


<!--____________________________________________________________________________________________ -->




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

<html:form method="POST" action="decisiontreexml" >
<!-- ------------------------------------------------ -->
<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>
</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="TreeViewApplet.class" codebase="C:/Users/ashutosh_k/idoc/docRuleTool/WebContent/WEB-INF/classes/com/vaannila/utility/" archive=" C:/Users/ashutosh_k/idoc/docRuleTool/WebContent/WEB-INF/lib/prefuse.jar" width="1000" height="500"  type="applet">-->
<form>
<applet code="com.vaannila.utility.dynamicTreeApplet.class" archive="./appletjars/dynamictree.jar, ./appletjars/prefuse.jar" width ="1000" height="500">
</applet>
</form>


<!--</applet>-->

</fieldset><p>
                                                                                
    </p>
    <p>Enter Follow Up Questions :</p>
<html:form method="POST" action="decisiontree">
                                                      
    <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"><p>                  
    </p>
</html:form>
</html:form>
</div>
</body> 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独陪着我 2024-12-07 01:48:22

当用户单击提交按钮时,我将使用 jQuery.ajax 动态加载决策树 div 内容。您需要将 Decisiontree div 内容代码放在单独的文件(decisiontree.html)中,并为您的提交按钮提供一个 id。

<script>
$(function()
{
    $("input#submit").live('click', function()
    {   
        loadApplet();
        return false;
    });

    function loadApplet()
    {
        jQuery.ajax({
            type: 'GET',
            url: 'decisiontree.html,
            success: function(data) {
                $('#decisiontree').html(data);
            }
        });
    };      
});
</script>

这是 jQuery.ajax 的重要资源: http://api.jquery.com/jQuery.ajax/

I would use jQuery.ajax to load the decisiontree div content dynamically when the user clicks the submit button. You would need to put your decisiontree div content code in a separate file(decisiontree.html) and give your submit button an id.

<script>
$(function()
{
    $("input#submit").live('click', function()
    {   
        loadApplet();
        return false;
    });

    function loadApplet()
    {
        jQuery.ajax({
            type: 'GET',
            url: 'decisiontree.html,
            success: function(data) {
                $('#decisiontree').html(data);
            }
        });
    };      
});
</script>

This is a great resource for jQuery.ajax: http://api.jquery.com/jQuery.ajax/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文