Javascript error help please

Discussions

Web tier: servlets, JSP, Web frameworks: Javascript error help please

  1. Javascript error help please (2 messages)

    when i execute the following jsp page to automatically refresh for 30 seconds its givig me a javascript error message that document.refreshForm object is null when form is submitted(document.refreshForm.submit()

    I have deined the action and form path in struts-config but still form is giving an error.
    can you please help how to solve the error.

    <%@ page import='java.util.*' %>

    <%@ page import='presentation.action.RefreshTimer' %>

    <%@page import='presentation.action.RefreshAction'%>

    <%@page import='presentation.form.RefreshForm'%>

    <script language="javascript" >

    var temp = window.setInterval('submitPage()',10*1000);


    function submitPage(){


    alert("before count submit");

    document.refreshForm.submit();

    var xyz = <%=application.getAttribute("counter")%>

    alert("New Request is " + xyz);

    }

    </script>


    <html:form action="/refresh.do" method="post" onsubmit ="submitPage()">


    </html:form>

    Threaded Messages (2)

  2. Javascript error help please[ Go to top ]

    Its giving the error because its not able to find resourceForm object on the jsp. Add "name" and "type" attributes in <html:form> it would work:

    <html:form name="refreshForm" type="presentation.form.RefreshForm"
    action="/refresh.do" method="post" onsubmit ="submitPage()">
  3. lost document object[ Go to top ]

    We have experienced the same proplem with:
    XP prof + IE 6
    Nevertheless, it works fine in W2K+IE6 and firefox.
    Believe the there is a bug in ActiveX in XP.

    What is your browser?

    Try a workaround
    http://www.twinhelix.com/javascript/htmlhttprequest/