views:

16

answers:

1

hi every one, i am facing a big problem right now. I have a html table in each row i have a button called edit allowing user to relod the form with parameter that he has selected. for this i define a hidden type to get the id of the record in database to access to various colonne and to refresh the form with those parameters. My challenge now is how to get the right id in every click on the edit button to let me after to get the right record and to update it in the data base. I am preceeding like the following:

retour.append("<td style=border-right:#FFF  bordercolor=#FFFFFF>");
retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\"  value=\""+object.getIdDailyTimeSheet()+"\"  name=\"hd"+compteur+"\" />");                             
retour.append("<button  id=edit name=edit type=button  onClick= editarow()>");
retour.append("<img src=edit.gif />");
retour.append("</button>");
retour.append("</td>");

i realise the submit in javascript and i want to get the idDailyTimesheet everyonce the user click the submit button. thanks for help.

A: 

Set the id of the button to the id in the database?

Or with html5 you are allowed to declare data-* tags on a html element.

Snake
I didn't understand you how putting the id of the record the same as the button could help to get the id in database.
kawtousse
Since you print your data from your database you already have the id right? So in the button element you define the id=idFromDatabase.
Snake