开发者

get the right id of a record in database in each click on the edit button

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 开发者_如何学Pythonhas 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜