Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Submit a form within an iframe along with the main form.

Posted on 2004-03-23
6
Medium Priority
?
1,124 Views
Last Modified: 2006-11-17
Hello I have a main form which contains an iframe. The iframe itself also contains a from. I am trying to submit the iframe form alongside with the parent form. I am just wondering if this is possible without copying the iframe's form values into hidden fields in the main form.

Any thoughts on this are appreciated.

Thank you.
0
Comment
Question by:girionis
[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
  • 5
6 Comments
 
LVL 35

Author Comment

by:girionis
ID: 10656042
Just to add, the iframe's form will eventually contain some inputs of type "file".
0
 
LVL 17

Accepted Solution

by:
dorward earned 332 total points
ID: 10656178
No, it is in a seperate document and thus is a seperate form. (And you can't set the value of file inputs using JavaScript, its a sucurity risk).

Why are you using an iframe anyway? Perhaps you would be better off with:

<form>
<input>
<div style="width: 20em; height: 10em; overflow: scroll; border: solid black 1px;">
<input type="file">
</div>
</form>
0
 
LVL 35

Author Comment

by:girionis
ID: 10656412
Hello dorward thank you for your quick reply. Yes I know about the value of the file inputs, that';s why I asked if I can do it without javascript.

I will look into using a <div> element and I will get back to you.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Author Comment

by:girionis
ID: 10656785
Ok using a div made things better but there is still a problem. I add the <input type="file"> dynamically to the form (we do not know in advance how many files the user will upload) but everytime I add a new file type it resets all the previous ones. I am using the following javascript:

divData.innerHTML = divData + "<input type='file'" + cnt + "'><br>"

where divData is the name of the div element and cnt is a global counter.

If I try to do it differently, adding an element to the node using

document.getElementById('divData').appendChild(inputFile);

where inputFile is the input type file I create,

it just does not send any of those with the request.

Any more thoughts?
0
 
LVL 35

Author Comment

by:girionis
ID: 10656794
Sorry, this:

> divData.innerHTML = divData + "<input type='file'" + cnt + "'><br>"

is actually

divData.innerHTML = divData + "<input type='file' name='fileName'" + cnt + "'><br>"
0
 
LVL 35

Author Comment

by:girionis
ID: 10657644
I will ask this question in the JavaScript category. Thank you for your help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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…

719 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