Hi I'm using ASP.NET MVC to try to postback after confirmation using javascript, this is the button:
<input type="submit" id ="RemoveStatus" value="Remove Status" name="button" onclick="return CheckRemove();"/>
This is my javascript in my CheckRemove() js function:
var button1 = document.getElementById("RemoveStatus");
if (confirm("Are you sure you want to remove status?") == true)
{
button1.disabled = true;
button1.value = "Removing status...";
__doPostBack('RemoveStatus', '');
return true;
}
else
{
return false;
}
But for some reason I get an object expected error at the __doPostBack bit, I've clearly set the id, button1 gets populated too in debug, i'v tried passing button1.id and button1 too into the __doPostBack call but it wont postback and keeps saying object expected, any ideas?