Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form within form

 
pendse anagha
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers ,
I have a form within a form ( please dont ask me why - but essentially
there is a huge jungle of HTML code and Java script that I need to maintain ) so thats the way it is .
Thanks for bearing with me .

Here is what I need to do :
There is a text area in the second form
I need to highlight some text in the text area of the second form
Then when I click a button ( in the first form ) I need to append some text prior to the highlighted text .

This works fine if the text area and the buttons are in the same form
but not when the text area is in the other form .

Here is the code that I have :


Can someone please help me out ?

Thanks in advance ,
-anagha
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anagha,
In this example, you have two forms one after another. Not a form within a form (luckily.)

You can use an absolute path type structure to access the textarea. For example, document.form2.txtArea2.value += "new stuff";
 
pendse anagha
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeanne ,
My mistake - I typed it incorrectly

I do have a form within a form .

Here is the corrected code :
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the rules on HTML, you can not have a form inside of a form and have it function correctly.....


What is the purpose of the two forms?

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic