hanigamal / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

can I have multiple EIPs on the same page via the same $("#div_text").editInPlace js/div ? #94

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

I cannot get EIP for more than once i.e. subsequent definitions don't
work e.g.

$(document).ready(function() {
$("#div_text").editInPlace({
url: "updatedata2.php"
});
});
<snip>

<body>
List items editable
<ul>
    <li id="div_text"> First one works i.e. can be EIP </li>
    <li id="div_text"> subsequent li's don't work, does not have EIP :( </li>
</ul>

I'm expecting subsequent to the first elements to be EIP too i.e.
    <li id="div_text">  should be EIP'able </li>

To fix, I have to include a new script like 
$(document).ready(function() {
$("#div_text2").editInPlace({
url: "updatedata2.php"
});
});
<snip>

and changing the 2nd li line to:
    <li id="div_text2"> subsequent does not have EIP :( </li>

Please provide any additional information below.

updatedata2.php contains:

<?php

//Add Code here to add or update $_POST['update_value']

//in a database or file

echo $_POST['update_value']; // Return the changed value so that is displayed 
to the user

?>

Thanks

Original issue reported on code.google.com by yfn...@gmail.com on 11 May 2011 at 3:59

GoogleCodeExporter commented 9 years ago
Nvm, fixed the problem with a css class rather than id.

Original comment by yfn...@gmail.com on 12 May 2011 at 2:14

GoogleCodeExporter commented 9 years ago
You can have multiple EIP's if you use that as a class instead of a div id. 
Also you want to keep the div id clean and unique because you will use that to 
update values in database.

Original comment by hmb...@gmail.com on 18 Oct 2011 at 9:55