• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Struts and Javascript Problem

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, here is my situation. I am using Struts <html:form tag to create a form. I've setup all required information for struts to process the form info and for everything to work correctly in my action mapping. My problem is that when i go to use any javascript on my page, the javascript console says the form I'm calling is not defined. I'm not sure why this is happening because when I look at the source-code of my page the form name is the exact name as I am using. Here is the code I am using in the order it appears in the source code.


Any ideas as to why it is saying the form is undefined? And Yes I know onClick is spelled wrong but it would not let me post it the correct way.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link:


The code:



Eric
 
Raistlin Zischer
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bar Keep for the advise, but that just didn't hit the spot.

If I use the document.form in the function call, then I get a javascript console error from Firefox where it says the "form" has no properties. If I use the fuction call without the "document." then I just get it where it says the "form" is undefined. Any ideas?

Thanks
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also you can not have a form tag inside of a table tag.

aka

NONO:

</tr>
<form>
</tr>

ok
<tr>
<td>
<form>
</form>
</td>
</tr>

OR

<form>
<table>
</table>
</form>

Eric
 
Raistlin Zischer
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip. I went ahead and moved the form tags. And then I went back through and did a rewrite of the fuction call and now the javascript works as excepted. I know where to come the next time I need help.

Cheers
 
Normally trees don't drive trucks. Does this tiny ad have a license?
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!