I am using javascript to parse a form and it uses the information on
that form to display some calculations (yes using PHP or something would
be easier, but not feasible for this project). So I would like to
include another file on my display page if a certain variable is
checked. My code is something like this.
<script type="text/javascript">
.......lots of code here
if (x.TPNroute == "peripheral")
{
pageData=pageData+"<br><b>Notes for Peripheral TPNs</b></br>"+
"<li>Dextrose should be <u><</u> 12.5%</li>"+
"<li>Calcium should be <u><</u> 8 meq/L</li>"
}
pageData+="<br><b>All 3-in-1 TPNs should have at least 2.5% lipids for
stability purposes</b>"
document.write(pageData);
if (x.displayRules == "yes")
{
alert("test");
src="TPNrules.js";
}
document.close();
</script>
The TPNrules.js file looks like
document.write("This is a test");
I want the contents of the TPNrules.js file to be displayed if
displayRules == true. It will be a lot of text which is why I don't
really want to put it just in the script itself, having another file
with the rules would make things look simplier. So how can I have the
contents of the file displayed? I know I am not using the right command
for this, but can't figure out which I should use.
Thanks for any ideas,
Andrew V. Romero