Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invoking javasript from code behind

Status
Not open for further replies.

shantoo

Programmer
Nov 16, 2007
2
US
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>");
 
I tried document.forms[0]
i tried document.formname.variable
I tried document.all.forms[0]

None of them work
 
>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>");
[tt]Response.Write("<script>function manageInjSubmit(){if (confirm('An event is scheduled for this clinic. Are you sure you want to block this date?')){document.forms[0].action='save'; document.forms[0].hencroachment.value='1'; document.forms[0].submit();}}; window.onload=manageInjSubmit;</script>");[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top