brianfarnell
08-24-2004, 05:05 PM
i am trying to load a raw xml file into a form to be submitted as xml to a server which is then processed by a javaservlet.
but its the getting the stored xml file to autofill the text area form field using javascript bring the contents in.
there is a dropdown list that links to a file (or this is what i want it to do)which then autofills the textarea field which then the form can be submitted.
ive looked for various ways to do this but im getting a bit lost
the current state of affairs is :
<HTML>
<HEAD>
<TITLE> Send XML</TITLE>
<LINK rel="stylesheet" href="style.css" type="text/css">
<script language="javascript" src="xmlstdalt.js"></script>
</HEAD>
<BODY>
<form name="testformadmin" action="#" onSubmit="return testSbmit();">
<select name="xmlstandard" size=1 onChange="showxmlstandard(testformadmin)">
<option selected>Select XML Standard</option>
<option value="XCBL20">XCBL 2.0</option>
<option value="XCBL30">XCBL 3.0</option>
<option value="XCBL35">XCBL 3.5</option>
<option value="xcml10">XCML 1.0</option>
</select><br><br>
<textarea rows="8" cols="60" name="displayxmlstandard"></textarea><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
script as follows ( this just emulates whats listed in the option value)
function showxmlstandard(thisform)
{
var myindex=thisform.xmlstandard.selectedIndex
var thisrate = thisform.xmlstandard.options[myindex].value
thisform.displayxmlstandard.value = thisrate
}
this bit i think would do what i want but i cant figure out how to link the 2 bits of script.
var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
xmldoc.async = false;
xmldoc.load("xmltest.xml");
Thanks for any help in advance
but its the getting the stored xml file to autofill the text area form field using javascript bring the contents in.
there is a dropdown list that links to a file (or this is what i want it to do)which then autofills the textarea field which then the form can be submitted.
ive looked for various ways to do this but im getting a bit lost
the current state of affairs is :
<HTML>
<HEAD>
<TITLE> Send XML</TITLE>
<LINK rel="stylesheet" href="style.css" type="text/css">
<script language="javascript" src="xmlstdalt.js"></script>
</HEAD>
<BODY>
<form name="testformadmin" action="#" onSubmit="return testSbmit();">
<select name="xmlstandard" size=1 onChange="showxmlstandard(testformadmin)">
<option selected>Select XML Standard</option>
<option value="XCBL20">XCBL 2.0</option>
<option value="XCBL30">XCBL 3.0</option>
<option value="XCBL35">XCBL 3.5</option>
<option value="xcml10">XCML 1.0</option>
</select><br><br>
<textarea rows="8" cols="60" name="displayxmlstandard"></textarea><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
script as follows ( this just emulates whats listed in the option value)
function showxmlstandard(thisform)
{
var myindex=thisform.xmlstandard.selectedIndex
var thisrate = thisform.xmlstandard.options[myindex].value
thisform.displayxmlstandard.value = thisrate
}
this bit i think would do what i want but i cant figure out how to link the 2 bits of script.
var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
xmldoc.async = false;
xmldoc.load("xmltest.xml");
Thanks for any help in advance