Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Jul 2007
Posts: 169
Reputation: tuse is an unknown quantity at this point 
Solved Threads: 14
tuse's Avatar
tuse tuse is offline Offline
Junior Poster

Ajax Help

 
0
  #1
Nov 29th, 2008
Hi!

I am using a code to echo a row in a database table using ajax with PHP.

The code is working correctly.

The ajax will send the response text as follows-

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. document.getElementById('outputText').innerHTML = httpObject.responseText;

My question is how can I retrieve individual fields into separate Id's?
My blog on .NET- http://dotnet.tekyt.info
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 319
Reputation: Luckychap is on a distinguished road 
Solved Threads: 42
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Posting Whiz

Re: Ajax Help

 
1
  #2
Nov 29th, 2008
Simply you have to parse the server response manually.

For example you get this a client side:

responseText = "field1||fiel2||field||......";

Then using javascipt string-functions to separate all the fields and use the your method of innerHTML to populate other text fields.
When you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 169
Reputation: tuse is an unknown quantity at this point 
Solved Threads: 14
tuse's Avatar
tuse tuse is offline Offline
Junior Poster

Re: Ajax Help

 
0
  #3
Nov 29th, 2008
Thanks for your reply.

Can you please tell me how to do that?

I'm not well versed with javascript.
My blog on .NET- http://dotnet.tekyt.info
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 169
Reputation: tuse is an unknown quantity at this point 
Solved Threads: 14
tuse's Avatar
tuse tuse is offline Offline
Junior Poster

Re: Ajax Help

 
0
  #4
Nov 29th, 2008
Ok, I googled a bit, I guess I can use the split() function for the purpose.

Thanks for your help!
My blog on .NET- http://dotnet.tekyt.info
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC