Am trying to call a jvascript confirm dialogue from code behind(C# asp.net).bUT IT DOES NOT DISPLAY THE DIALOGUE. DOCUMENT.ALL.FORMS[0] is not recognized. Any idea what i am doing wrong?
Response.Write("<script>function manageInjSubmit(){if(confirm('An event is scheduled for this clinic. Are you sure you want to block this date?')){document.all.forms[0].action.value='save';document.all.forms[0].hencroachment.value='1';document.all.forms[0].submit();}};window.attachEvent('onload',manageInjSubmit);</script>");
Response.Write("<script>function manageInjSubmit(){if(confirm('An event is scheduled for this clinic. Are you sure you want to block this date?')){document.all.forms[0].action.value='save';document.all.forms[0].hencroachment.value='1';document.all.forms[0].submit();}};window.attachEvent('onload',manageInjSubmit);</script>");