hey guy, i found a problems during my project, i write a web apps in jsp html, i found that i can call a java function by succesfully. the scenario is like this :

Below is my html code of button, i got two button here, 1 is submit button to submit all data to DB, and the cancel button is use to clear some data in DB, i used to call a function to clean the data in DB.


<td colspan="3" >
                            <input type="submit" name="Submit" value="Comfirm" />
                                        <input type="button" name="Cancel"  value="Cancel" onClick="<%function.cancelDuration(rentalID);%> window.location='payment.jsp';"  />                                      


But the problems i faced is, no matter which button i click during testing, the java function will invoked. what i want is when i click the "cancel" button, the java function cancelDuration() only will call, but now even i click the button "submit", the function cancelDuration() also will be called, anyone have idea what going on here and any solution idea you can share with me ? TQ

i don't see any action corrsponding to "Submit" button, so, by default it takes that is mentioned over there