Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
JavaScript function needed to load a link from a XML file
Old 04-21-2009, 04:31 PM JavaScript function needed to load a link from a XML file
Junior Talker

Posts: 1
Name: Kerry
Trades: 0
Here's what I want to do:
When a user starts to type in a document name, the autosuggest fills in the rest of the name of the document. This part already works no problem. Then, when the user clicks on the search button, I want the document to be loaded on the webpage. So far, I have been able to get a JavaScript popup to tell me which document I selected.
The JavaScript code that I have is:
Code:
<script type="text/javascript">
function disp_alert()
{
var txt=document.getElementById("document").value
alert("You selected "+ txt);
}
</script>
The above code works, and is pulling from my xml file, but it's just telling me what I put into the text box. I really want it to link to the document or page it's supposed to link to. Does anyone know a JavaScript function to load a link from a XML file?
The XML code that I have is:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<documents>
 <document id="1">
  <name>Fax Form 1</name>
 </document> 
 <document id="2">
  <name>Fax Form 2</name>
 </document>
 <document id="3">
  <name>Fax Form 3</name>
 </document> 
</documents>
Now, I know there should be code in my xml file to link to the forms, but I have been trying to figure that out but can't.
Can anyone please help me?
Thank you!
bigdisneyfan is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to JavaScript function needed to load a link from a XML file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08103 seconds with 12 queries