2014-10-05 49 views
0

我有这样的一个表一个jsp:从排在HTML中获得价值,并用它在JSP

<table style="width:100%"> 
    <thead> 
    <tr> 
     <th>ID</th> 
     <th>Name</th> 
     <th>Adress</th> 
    <tr> 
    </thead> 
    <tbody> 
    //here is a loop filling the table 
    <tr data-toggle="modal" data-target="#modal"> 
     <div> 
      <td>${id}</td> 
      <td>${name}</td> 
      <td>${adress}</td> 
     </div> 
    <tr> 
    </tbody> 
</table> 

所以我想用从表中的id模式(这是一个弹出对话框)获取一些信息,但我无法获取用户正在按的行的值。 任何帮助将有所帮助。

回答

0

我建议使用JavaScript来做到这一点。您可以将onclick事件添加到您的div,该行的ID作为参数传递给javascript函数。然后,该功能并打开模式对话框。

<div onclick="openPopup(${id})">