Suppose In a jsp page I have a button SAVE with id="btnSave" value="SAVE" and a javascript function ajaxInsertUpdateData(arg,......) to call a servlet InsertUpdate.java. Onclick event of SAVE button will call ajaxInsertUpdateData(document.getElementByID("btnSave").value,......);
Now I want the SAVE button to be changed to UPDATE button id="btnSave1" value="UPDATE" and onclick event of UPDATE button will call ajaxInsertUpdateData(document.getElementByID("btnSave1").value,......); How to do this?
Ads