Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can form with javascript pull data from xml file?

Status
Not open for further replies.

superfly404

Technical User
Feb 1, 2005
24
US
I have a very simple form on my page (below)

<form name="form1" method="post" action="">
From
<input name="textfield" type="text" size="3" maxlength="3">
To
<input name="textfield" type="text" size="3" maxlength="3">
<br>
<br>
<input type="submit" name="Submit" value="Submit">
</form>

Is there a way to setup a javascript that will pull data from an XML file based on what was entered in the form, and then render the data from the XML file back into the page?

For example:

If you entered in the From: filed "ABC" and in the To: field "XYZ" - I'd like for the javascript to return from the xml data below from an xml file hosted on the same server.

<PAIR FROM="ABC" TO="XYZ" DEFINE="ABC TO XYZ">
<DATE="October 15, 2005" ON="Monday"></DATE>
<DATE="October 21, 2005" ON="THURSDAY"></DATE>
</PAIR>

And render it back into the page like this:

From: ABC to XYZ
October 15, 2005 - Monday
October 21, 2005 - Thursday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top