• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

html : form

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
I got a <html:form> tag that includes <html:text> in my struts web-based app. When I load this page, I got the following JavaScript error message: "document.forms.statusForm.elements is null or not an object".
I've realized the problem is the focus attribute in <html:form> tag, cause once I take it off, everything works fine.
<html:form action="AlterarStatus.do" focus="siglaStatus">
...
<html:text property="siglaStatus" styleClass="FIELD" size="30" />
...
</html:form>
Follows the script generated by the struts tags in my JSP (generated only if the focus attribute is set):
<script language="JavaScript" type="text/javascript">
<!--
if (document.forms["statusForm"].elements["siglaStatus"].type != "hidden")
document.forms["statusForm"].elements["siglaStatus"].focus()
// -->
</script>
Anybody can see what is wrong?
Tks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic