This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

including a file in jsp  RSS feed

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am including a jsp inside one of my jsps as follows

<form method="post">
......some code
<%@ include file="addressFind.jsp" %>
.....some more code
</form>

now in my javascript function when I say document.forms[0].element then it gets the form from addressFind.jsp and not the current form. and when i say document.forms[1].element then it says forms[1] has no properties. How can I include the file and still be able to access my current form. This page is a popup page.
Thanks
Imad
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are including a form within another form then you are generating invalid HTML. It has nothing to do with the include -- the same thing would happen if you didn't use the include and generated an HTML file with a form within a form.

Remember, JSP is just a templating technology to generate the HTML page to send to the browser. It's your repsonsibility to ensure that the HTML that gets generated is valid.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!