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>
-
Javascript error help please (2 messages)
- Posted by: sirisha koka
- Posted on: January 28 2006 11:51 EST
Threaded Messages (2)
- Javascript error help please by Neha Jadia on January 30 2006 10:44 EST
- lost document object by martti pitkanen on March 14 2006 06:54 EST
-
Javascript error help please[ Go to top ]
- Posted by: Neha Jadia
- Posted on: January 30 2006 10:44 EST
- in response to sirisha koka
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()"> -
lost document object[ Go to top ]
- Posted by: martti pitkanen
- Posted on: March 14 2006 06:54 EST
- in response to Neha Jadia
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/