Hi , Pls look into the below function thru which i am calling a modal dialog. After the dialog returned true I am calling document.forms[0].submit();But I am getting an error. object expected. Pls help me out . The function is given below. function fnOpen(targetPage) { myObject.value = "emp1"; alert(myObject.value); var returnstring = showModalDialog('child.jsp', myObject, "dialogHeight:30px; dialogWidth:400px; scroll:no; status:no; unadorned:no; resizable:no; edge:raised; dialogLeft:middle; dialogTop:middle; center:Yes"); alert(returnstring); if(returnstring) { document.forms[0].action="/testworkspace-ViewController-context- root/testservlet"; document.forms[0].submit(); } } <input type="button" name="submit" id="deleteenable" value="DELETE" onclick="fnOpen('child.jsp');" >
Give the submit button another "name". It's conflicting with the submit() function name. Or remove the name... <input type="button" id="deleteenable" value="DELETE" onclick="fnOpen('child.jsp');" > HTML: