i have created a button(Delete). <input type=button name=del value=delete> now i want when i click this button the deleteRec() funtion of my utility class called which delete a record from database.and the current page reloaded. like this.. <% Delete obj = new Delete(); obj.deleteRec(-,-); %> how could i do this ?
Client and Server side code. The button gets shown on the client and can only execute client side code (javascript). The code required to remove a record from the database happens on the server. What you need to do is have the button (on the server side) send a message (HTTP request) to the server with the details required to perform the db operation then return a response to the client. Does this clear it up? Dave.
kashif iftikhar
Ranch Hand
Joined: Aug 21, 2001
Posts: 43
posted
0
yes , i have done something like this. 1. put a hidden field in the form. 2. when yhe user click the button value set to "delete". 3. and then make a connection to the database. 4. get reference to the EJB Home. 5. call obj.remove() method to remove selected data.
------------------
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.