Jump to content
DickDeeds

AJAX/XML/Javascript read problem

Recommended Posts

Hi all,Below is the code and what is returned from the code. Even though I'm using the request.responseXML I get the message:[Object HTMLCollection]. It obtains the data correctly and inserts it into the XML code. Can you help??PHP function writing the code from databaseheader("Content-Type: text/xml");echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";echo "<inform>\n";echo "<From_Date>" . $rr['PP_From_Date'] . "</From_Date>\n";echo "<To_Date>" . $rr['PP_To_Date'] . "</To_Date>\n";echo "<Pledge_Amount>" . $rr['PP_Pledge_Amount'] . "</Pledge_Amount>\n";echo "<Contribution_Amount>" . $rr['PP_Contribution_Amount']. "</Contribution_Amount>\n";echo "</inform>";Javascript using the request object. alert(request.responseText); var xmlDoc = request.responseXML; var From_Date = xmlDoc.getElementsByTagName("From_Date"); document.frm_pledge_pledged.From_Date.value=From_Date; var To_Date = xmlDoc.getElementsByTagName("To_Date"); document.frm_pledge_pledged.To_Date.value=To_Date; alert("From="+From_Date+" To="+To_Date);From requequest.responseText From request.responseXML TIA,###### Deeds

Share this post


Link to post
Share on other sites

I believe you have the problem with your getElementsByTagName('tagname') bit, it's supposed to be getElementsByTagName('tagname')[itemnumber].nodeValue

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...