I have a form in Spring with two buttons on a JSP file.
<input type="button" onclick="saveFormActions(this.form)" class="btn primary publish border16" id="saveBtn" value="Save"/>
<input type="submit" class="btn primary publish border16" id="publishBtn" value="Publish"/>
When the Save button is clicked, it should trigger an Ajax call by passing the form as an argument.
function saveFormActions(form){
jsonData={};
jsonData = form;
VR.appendToJSObject(jsonData);
var jqxhr = $.post(saveFormActionsURL, jsonData, function(returnString) {
if (returnString == 'true'){
showAutoSaveMessage();
}else{
alert(returnString);
window.location.reload();
}
});
jqxhr.error(function(data){
//This one is highly unlikely
alert("There was a problem - please contact support");
window.location.reload();
});
However, I am encountering the following JavaScript exception:
TypeError: 'stepUp' called on an object that does not implement interface HTMLInputElement