Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-03-23
6
Medium Priority
?
1,130 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
  • 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

Independent Software Vendors: 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!

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…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

783 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