Hi Matt,
Thanks for your reply. I couldn't get this to work, but I appreciate your 
taking the time to reply.
I'm thinking of just having the user use a regular form for requests with 
multiple records, and continue to use editinplace for requests with just one 

>>> Matt Andrews <mattpointbl...@gmail.com> 12/22/2008 3:07 AM >>>

You could just make your code into a function and pass the same php
variable as the parameter:

function newInPlaceEditor(itemID)
new Ajax.InPlaceEditor('title_'+itemID, '/demoajaxreturn.html', {rows:

then your code:

<div id='title_<?php echo '$id'?>'><a href="javascript://"
onclick='newInPlaceEditor(<?php echo '$id'; ?>'>edit me</a></div>

(not tested)


On Dec 20, 10:41 pm, Audg <abe...@ccc.edu> wrote:
> Hi,
> I was wondering if anyone could lend a hand with the fabulous
> Ajax.InPlaceEditor script!
> My question is this: Is there a way to generate an ID on the fly that
> would make the id unique?
> Because I have a one-to-many situation with my database, there are
> times when I'm displaying multiple records, which would result in
> duplicate item ID's and confuse the script.
> For example, One Author could have many book titles...but I don't know
> how many books the author has written until I query the database....so
> I would need to create the id's on the fly.
> I can make the div dynamic with php <div id='title_<?php echo '$id'?>'>edit 
> me</div>
> but is there a way to pass this same id to the new Ajax.InPlaceEditor
> to make it match?
> <script type="text/javascript">
>  new Ajax.InPlaceEditor('editme_THIS_WOULD_BE_A_UNIQUE_RECORD_ID', '/
> demoajaxreturn.html', {rows:15,cols:40});
> </script>
> Thanks for any help you can provide!

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to