0

I want when click button Delete, I would get CustomerID and send to Action. To execute function delete.

<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>
msrd0
  • 7,816
  • 9
  • 47
  • 82
No Name
  • 1
  • 1

1 Answers1

0

pass the customerID parameter to your js function like this:

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

or

pass this to your js function and then navigate trough your html code using js or jQuery for example you can use something like this:

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