asp.net - Javascript/DOM Why is does my form not support submit()? -


This is my first time working with asp.net and javascript, so I do not know very good web resources, or Much about javascript debugging I have to find out that on line oFormObject.submit (); Microsoft JScript Runtime Error: Object does not support this property or method

I am using the link to work as a button because I am terrible in aesthetics and I think That link will look more professional than a table of 50 buttons. I have read that this solution can cause problems with browsers due to pre-rendering of my links and many additional traffic and problems, but CSS gives me a button like a link, which has issues of alignment and difference seemed to.

  & lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 // N" "http://www.w3.org/TR/html4/strict.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "defect difference.css" /> gt; & Lt; Title & gt; Defect Critical Assessment Code List & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form name = "form1" method = "post" action = "CodeList.aspx" id = "form1" & gt; & Lt; Div & gt; & Lt; Input type = "hidden" name = "__ VIEWSTATE" id = "__ vistat" value = "/ wEPDwUJNjQzMTI3NjU4ZGSW2wNBW3eGztyO + Tftc5BB8A6cMg ==" /> & Lt; / Div & gt; & Lt; Div & gt; & Lt; P & gt; Welcome maslow & lt; / P & gt; & Lt; SCRIPT language = "javascript" & gt; Function Submitform (Intuit) {oFormObject = document.getElementById ("" Form ++ StrontidID + @ "" ""); OFormElement = document.getElementById ("codeId"); OFormElement.value = intId; OFormObject.submit (); } & Lt; / SCRIPT & gt; & Lt; Form method = "post" action = "CodeAssessment.aspx" id = "formcodeId" & gt; & Lt; Table name = "codeId" id = "codeId" value = "0" type = "hidden" class = "linkTable" & gt; & Lt; TR & gt; & Lt; Th & gt; Full & lt; / Th & gt; & Lt; Th & gt; Code & lt; / Th & gt; & Lt; Th & gt; Details & lt; / Th & gt; & Lt; Th & gt; Since the code & lt; / Th & gt; & Lt; / Tr & gt; & Lt; Tr square = "row" & gt; & Lt; Td> & Lt; Input name = "401" type = "checkbox" value = "401" /> gt; & Lt; / Td> & Lt; Td> & Lt; A href = "javascript: submitForm (0);" & Gt; 401 & lt; / A & gt; & Lt; / Td> & Lt; Td> Missing original document / form & lt; / Td> & Lt; Td> 2009.10.16 & lt; / Td> & Lt; / Tr & gt; & Lt; Tr class = "rowAlternate" & gt; & Lt; Td> & Lt; Input name = "NDMI" type = "checkbox" check = "checked" value = "ndmi" disabled>> gt; & Lt; / Td> & Lt; Td> & Lt; A href = "javascript: submitForm (1);" & Gt; NDMI & lt; / A & gt; & Lt; / Td> & Lt; Td> The date of note is missing & lt; / Td> & Lt; TD & gt; 2009/10/15 & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Input type = "submit" / & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

If I write the script line to oFormObject = document.forms [0]; , then it posts the ASP.net's viewstate form back to the same page instead, where I want to go, the rest of the code on the page appears to be working.

So we solved it in another answer, but using the comments, it's just another The problem is similar to that,

It is under the form with a runat = "server" attribute, it creates the visual input, then when the form is submitted on the second page, the page Trying to fill up, though in this case, the form gets deposited on the second page, two The page does not match and when it tries to deal with the viewstrate input, it throws the error.

The solution is to either set the runat = "server" attribute on the form or to set the EnableViewStateMac = "False" attribute from the second page.


Comments

Popular posts from this blog

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -