Hi all,
I'm having the problem while using the edit-in-place scripts from internet. It's ok when i just used for one text id, but after i added a while loop because of multiple items and it become only the 1st text id content works. So below here i post a piece of my code, hope any here can help on this. How to do the multiple items with the same id? Please help. Thank you very much.

while($disp=mysql_fetch_array($disp_de))
{           
echo '<tr><td>';
$dis= $disp['pp_desc'];
echo "<p id=\"desc\">".$dis."</p>";
echo '</td></tr>';
}

How about giving each item a unique id? Just add an extra variable:

$count = 0;
while($disp=mysql_fetch_array($disp_de))
{           
echo '<tr><td>';
$dis= $disp['pp_desc'];
echo "<p id=\"desc".$count."\">".$dis."</p>";
echo '</td></tr>';
$count+=1;
}

Edited 5 Years Ago by Nick Evan: n/a

How about giving each item a unique id? Just add an extra variable:

$count = 0;
while($disp=mysql_fetch_array($disp_de))
{           
echo '<tr><td>';
$dis= $disp['pp_desc'];
echo "<p id=\"desc".$count."\">".$dis."</p>";
echo '</td></tr>';
$count+=1;
}

Thanks Nick, i think you provided a good solution. But it doesn't work for me. Do you know about javascripts? Because I don't really good in that, but i think that maybe should modify something in the function init() there, can you help me about this? for the moment, i'm using the

makeEditable('desc');

inside the function, but there's another suggestion that suggested by others in the comments part of the page, they put

for(i=1; i<max; i++){
makeEditable('item_'+i ; );
}

inside the function init() of the sditinplace.js. But it can't work in my case, I don't know why, please guide me. Thanks a lot.

Edited 5 Years Ago by Nick Evan: n/a

Do you know about javascripts?

No.

Maybe you should ask this question in the javascript/ajax forum to get some meaningfull responds.

Edited 5 Years Ago by Nick Evan: n/a

This article has been dead for over six months. Start a new discussion instead.