?
Solved

FORM within FORM to show results in IFRAME

Posted on 2008-10-06
3
Medium Priority
?
866 Views
Last Modified: 2012-06-21
I have a FORM, which contains another FORM that is supposed to show its results within an IFRAME.
See my sample PHP files.  I cannot seem to get the SUBMIT for the inner form to do anything. I would like to execute another PHP script from that inner FORM and show its results in an IFRAME.  When the page is initially shown, the IFRAME does pick up the initial input from the fileControl.php script.  The inner form is a file upload form and uses POST.  What am I doing wrong?   According to all doc I read, I should just have to add a TARGET='iframename' to my inner form and the results will be displayed in the IFRAME.
<form name='editform' id='editform' action='editform.php' method='post'>
<input ....>
<input ....>
<input type='submit' value='Submit'>
<iframe src='fileControl.php?td=2008-09-02&tn=004G4&ts=SLO2&sc=CC' name='iframeControl' id='iframeControl' class='filecontrol'></iframe><br />
 
<form action='fileControl.php?td=2008-09-02&tn=004G4&ts=SLO2&sc=CC' method='post' enctype='multipart/form-data' name='uploadform' target='iframeControl' id="uploadform">
<input type='hidden' name='MAX_FILE_SIZE' value='2000000000000' /><input name='userfile' type='file' class='buttonBox' id='userfile' />   
<input name='upload' type='submit' class='buttonBox' id='upload' value='Upload' />
<input type='hidden' name='submitted' value='true' />
<input type='hidden' name='td' value='' />
<input type='hidden' name='tn' value='' /><input type='hidden' name='ts' value='' />
<input type='hidden' name='sc' value='' />
</form>
</form>

Open in new window

0
Comment
Question by:mamuscia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 22650955
>>I cannot seem to get the SUBMIT for the inner form to do anything.
Correct. Nested forms are NOT allowed. The browser ignores the inner form tag. You must UN-nest them or use a single form.
0
 

Author Closing Comment

by:mamuscia
ID: 31503456
You were right.  When I include the "inner" FORM on the page within the IFRAME, it operates as it should.  So, I did some tinkering with my CSS to have the file control not scroll and the list of files to scroll within the IFRAME.  That way, the file control always shows at the top while the user can scroll through the list of files.  Thanks for confirming this.
0
 
LVL 82

Expert Comment

by:hielo
ID: 22651698
you are welcome.
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question