Solved

FORM within FORM to show results in IFRAME

Posted on 2008-10-06
3
829 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
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
Comment Utility
>>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
Comment Utility
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
Comment Utility
you are welcome.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now