Solved

FORM within FORM to show results in IFRAME

Posted on 2008-10-06
3
856 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 500 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
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.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

705 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