Solved

FORM within FORM to show results in IFRAME

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP curl issue VERBOSE output 18 35
PHP Form Calculate Total Price 10 40
website maintenance mode 1 17
Can't get js include to work in html file 8 8
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

785 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