I have designed a form that sends a list of products to the spring backend. This form consists of two separate buttons:
- A "Submit" button for submitting the form.
- A "Fetch available Stock" button for checking stock availability.
When the "Fetch available stock" button is clicked, it should trigger a function that makes an Ajax call to retrieve stock details. However, the issue I am facing is that clicking this button causes both the Ajax call for fetching stock data and form submission to occur simultaneously.
I specifically want the form submission to only happen when the user presses the "Submit" button.
Note: The form is located within a bootstrap modal.
Thank you in advance for any assistance provided!