2014-10-11 13 views
0

버튼을 클릭하고 싶을 때 삭제, 나는 CustomerID을 보내고 액션으로 보냅니다. 기능 삭제를 실행합니다. 저점 JS 또는 예를 들어 jQuery를 를 사용하여 HTML 코드를 탐색 한 후 JS 함수에스트럿과 함께 디스플레이 태그를 사용하는 방법 1?

<display:column title="checkkbox"> 
     <input type="checkbox" onclick="selectCheckbox(<bean:write value="customerID" />);" id="checkBox" /> 
    </display:column> 

또는

패스 this과 :

<display:table name="sessionScope.CustomerForm.customers" id="row" 
     requestURI="/Customer.do" pagesize="15" style="text-align:center" 
     excludedParams="_chk" clearStatus="true"> 
    <display:column title="checkkbox"> 
     <input type="checkbox" onclick="selectCheckbox();" id="checkBox" /> 
    </display:column> 
    <display:column style="width:500px" property="customerID" 
      title="Customer ID" sortable="true" paramId="customerID" 
      href="Edit.do"> 
    </display:column> 
    <display:column style="width:300px" property="customerName" 
      title="Customer Name" sortable="true" /> 
    <display:column style="width:300px" property="sex" title="Sex" 
      sortable="true" /> 
    <display:column style="width:300px" property="birthday" 
      title="Birthday" sortable="true" /> 
    <display:column style="width:300px" property="email" title="Email" 
      sortable="true" /> 
    <display:column style="width:300px" property="address" 
      title="Address" sortable="true" /> 
</display:table> 
</div> 
<br> 
<div> 
    <html:button styleClass="submit" property="Add new" value="Add New"></html:button> 
    <html:button styleClass="submit" property="Delete" value="Delete" ></html:button> 
</div> 
</html:form> 
+0

정확도 너 질문 있니? – EWit

답변

0

은 다음과 같이 당신의 js 함수에 CUSTOMERID의 매개 변수를 전달 다음과 같이 사용할 수 있습니다.

function selectCheckbox(element){ 
      var customerID = $(element).parent().children("td")[1].html(); 
      // do your stuff! 
} 
관련 문제