Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-24-2009, 09:57 AM   PM User | #1
magnetica
New to the CF scene

 
Join Date: Aug 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
magnetica is an unknown quantity at this point
Dynamic name changing

Hi I have a piece of code which calls upon AJAX and an external file to display something from the database, now the code below works fine but because it is within a loop it always echo's to the top div on the page. Take a look

Code:
<?php
		$ajax = new Ajax('displayArea');
		?>
	<form>
		<input type="button" value="Click me" name="name_button" onclick="sendReq('serverfile.php', 'id', '<?=$yt_id?>')" />
	
	</form>
	
	<br/>
	<div id="displayArea">
		Hello
	</div>
Now I understand that this is probably due to the fact that the id for the div's are the same all the way down so it echoes to the top one.

Or I thought I might also have to dynamically change the object name but how do I do this?

Any thoughts? Thanks
magnetica is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:33 PM.


Advertisement
Log in to turn off these ads.