Forum Moderators: open
function DeleteEntry(ID)
{
var rtn = confirm("Are you sure you want to delete this record?");
if (rtn == true)
{
document.writeln("<form method='POST' id='delData' name='delData'>");
document.writeln("<input type='hidden' name='Mode' value='DELETE'>");
document.writeln("<input type='hidden' name='CollectionID' value=\"" + ID + "\">");
document.writeln("</form>");
window.document.delData.submit();
}
}
I need Mode and CollectionID to get repassed through post, which this does in IE but in Firefox JavaScript Console I get Error: window.document.delData has no properties. Any suggestions as to what is going on? Also I'm unclear about the escape quotes for value = ID. This does work to pass the value but the notation seems strange to me.
Thanks.
I might not understand correctly but document.forms.delData.submit() gives the same error. The current page uses POST to get the information, and from what I understand I'd have to use GET to use the url method.
If I do something like this:
document.writeln("<form method='POST' id='delData' name='delData'> test");
a page with 'test' shows briefly then the page reloads and performs the delete correctly. So the form has no data using the hidden values I guess. Is there anything else I could try.