This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Form within form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Form within form" Watch "Form within form" New topic
Author

Form within form

pendse anagha
Ranch Hand

Joined: Mar 09, 2005
Posts: 44
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

Joined: May 26, 2003
Posts: 32481
    
214

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";


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
pendse anagha
Ranch Hand

Joined: Mar 09, 2005
Posts: 44
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

Joined: Nov 08, 2001
Posts: 15385
    
    6
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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Form within form
 
It's not a secret anymore!