I am writing a simple jsp to retrieve and save from/to my MySQL db. My retrieve and save functions work great. Now, depending on the action in the browser, I would only like to invoke one of the methods. For example, for the onChange event, I would like to get the info from the db. For the onClick event, I would like to save the info to the db. Considering these actions are on the client side and jsp is on the server side, is there a way to do this? If not, does anyone have a suggestion on how this can be done?

Adrian K

Here you are:

 <input type="hidden" id="hiddenInputField" name="hiddenInputField" value="initialValue">

<input type="button" onclick="changeValueAndSubmit('newValue')">
        function changeValueAndSubmit(target){