I really like your Javascript solution, Kevin. However, I realized the
problem was actually a bit more complex than I was making it.  The
database table I am editing requires two primary keys to make an entry
unique (I'm a firm believer in a single PRImary key, but it wasn't my
choice).  One of the two keys can be changed by this form, so it
causes problems. I came up with a few solutions, but in the end, we
decided it would be easist (quick but dirty) to go ahead and just
delete all rows associated with the document and then reinsert them.
This way, we are sure to get the exact information that we want from
the users.

Thanks a lot for the quick responses guys.  I'll definitely keep the
JS flag tucked away in the back of my mind.

~ Andrew Tomaka

On 7/27/05, Andrew Tomaka <[EMAIL PROTECTED]> wrote:
> Hey all,
> 
> The following is pretty hard to understand.  I'm no good at describing
> my problems and wasn't sure how to explain it.  Hopefully, someone
> will get what I'm attempting to say
> 
> I'm working on a screen that allows a user to dynamically add rows via
> Javascript. I then have have a form that contains a list of beans that
> stores the data (but that's really beside the point).
> 
> My issue comes with the storage of this information.  The form can
> either be a blank form or it can be preloaded with other information
> depending on whether the record exists or not.  If it is preloaded,
> the user can edit the existing rows or add new rows.  The problem
> comes when I need to update the database.  When the user hits the save
> button, it submits all the information, but I have no way of telling
> if a specific row was edited or created. Because of this, I don't know
> whether to make an UPDATE query or an INSERT query.  Can anyone think
> of a creative way to do this without adding an extra query for each
> row?
> 
> Any insight would be greatly appreciated!
> 
> Thanks,
> ~ Andrew Tomaka
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to