1

I have a button that is used for displaying an annual leave request by doing an ajax call to a servlet which then retrieves data in the response and displays it on the modal. 'view modal' buttons in a table.

Once one of these buttons are clicked, they run a javascript function which does an ajax call and displays the data that recieved on the modal (Screenshot). Basically I need another ajax call to a servlet as and when the "respond to request" panel is clicked. I've heard of event binding which might be useful for solving my issue, however being the newbie I am, I haven't seen an example of how this works that I understand so maybe someone could attempt to provide one here for me.

The second ajax call is to basically running a query against the database to check whether or not the currently logged in user on my web app has already accepted/declined the request so that I can disable/remove the buttons without refreshing the page.

Thanks in advance!

1 Answers1

0

Two options for submitting different calls:

Each button submit different form, each form submit different action - example with jquery

Each button submit different JavaScript function the execute different ajax call - example JavaScript

Ori Marko
  • 56,308
  • 23
  • 131
  • 233