DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Ajax Help (http://www.daniweb.com/forums/thread160004.html)

tuse Nov 29th, 2008 11:38 am
Ajax Help
 
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-

document.getElementById('outputText').innerHTML = httpObject.responseText;

My question is how can I retrieve individual fields into separate Id's?

Luckychap Nov 29th, 2008 2:43 pm
Re: Ajax Help
 
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.

tuse Nov 29th, 2008 2:49 pm
Re: Ajax Help
 
Thanks for your reply.

Can you please tell me how to do that?

I'm not well versed with javascript.

tuse Nov 29th, 2008 3:05 pm
Re: Ajax Help
 
Ok, I googled a bit, I guess I can use the split() function for the purpose.

Thanks for your help!


All times are GMT -4. The time now is 12:58 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC