Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-19-2009, 06:30 PM #1
- Join Date
- Jan 2009
- Thanked 0 Times in 0 Posts
Ajax write response in different span tags with an ID generated with PHP
First of all, HI. it's my first post.
I don't even know if this is the way to approach the problem, if not, please tell me. Here is what I am doing and what I want to do:
JS to output server response:
<span id="response">Here comes the response:</span>
I got this to work. However, I want the feedback to be in different spans depending on the unique id that I generate with PHP.
<span id="response<?php echo $uniqueid; ?>">Here comes the response:</span>
if the entry with id 5 is updated, i want the response to go to the span with response5 and no others.
I don't know how to approach this problem.
01-20-2009, 04:44 PM #2
however you're calling your ajax.... pass the id as an arg
Code:<span id="<?php echo $uniqueid; ?>" onclick="domyajax('<?php echo $uniqueid; ?>');">Here comes the response:</span>