Solved

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

Posted on 2004-03-23
6
1,089 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 83 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Joomla Website Malfunction 9 53
Hover Gone 16 31
text align center the options is an html select 4 28
Login area of a page 4 19
Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
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…

760 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

20 Experts available now in Live!

Get 1:1 Help Now