Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FORM within FORM to show results in IFRAME

Posted on 2008-10-06
3
Medium Priority
?
874 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

618 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