hi frnds..


i am using while loop for getting more records..in this having div..i need to change div name dynamically...but right now i cant do that code...plz change the below code.....

<DIV id="div_MoviePicRate" name="div_MoviePicRate" class="text2_grey" align="left">&nbsp;
<IMG alt="I Agree, Your life Sucks" src="images/up.png"  style="cursor:pointer" border="0" onclick="javascript:TF_RateThumb(<?php echo $p_id; ?>,<?php echo $f_id; ?>,1,&#39;[B]div_MoviePicRate&#39[/B];);">

here main problem is , my having having more number of records on same div name....how can i create dynamic div with different names....


javascript code..

function TF_RateThumb(MasterPicID,PicID,RateVal,divObj)
	{
	    /
		showHintPoll('picturerate.php?cid='+MasterPicID+'&pid='+PicID+'&rate='+RateVal+'&',divObj,'-1');
	}

Recommended Answers

All 2 Replies

anybody help plz..

You could add an incremental variable to the code, such as this one :

$i = 1;
foreach($d_array as $da) {
   echo '<div id="name_of_'.$i.'">Content at '.$i.'</div>';
   $i++;
}

hope you know what i mean.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.