Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3321590
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:04:51+00:00 2026-05-17T23:04:51+00:00

I’ve got a form that has a detail section iframed in. Take a look

  • 0

I’ve got a form that has a “detail” section iframed in. Take a look here:

[URL Removed]
click add item,

then you’ll see that you can type in the first 5 fields and hit update. These will save as expected.

Try adding in some data into the “vintages” section (fill in all fields) and click “Save and Add”. This will save your edit and add a new record for editing. This is iframed in.

Now. My issue is that if I complete the first 5 fields, then type in the vintage information but do not click “save and add”, only clicking “update” it won’t submit the iframe and the data contained within will be lost.

Any suggestions on how I can make this outform also submit the inner form.
I’ve already tried this:

<script>
$(function(){
   $('#item_edit').submit(function(){
       alert('try');
 $('iframe').first().contents().find('.form').submit();
   });
});
</script>

In fact this is on the form at the moment and it doesn’t work. It will run but it doesn’t want to submit. In addition, if I manually run $('iframe').first().contents().find('.form').submit(); then it will submit and save the contents of the detail/vintage form. So I think the parent form submits before the child form has a chance too.

Any ideas on how to avoid this?

Jason

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:04:52+00:00Added an answer on May 17, 2026 at 11:04 pm

    The page you linked to has disappeared, so I can’t go look at your complete example. But here are a few thoughts to consider…

    When I do this kind of thing, I generally avoid building the sub-form in the iframe. Instead, I put all the fields into a single form. New fields are added dynamically, if necessary, all in the same form.

    You can then submit the entire form as whole if you need to — that part becomes easy.

    If you need to submit just a portion of the form, you can “cherry-pick” the fields that you want at submit time.

    To do this kind of “cherry-picked” submit, just create a new hidden iframe with a form in it; then use [jQuery’s .clone() function] to copy the fields you care about, and stuff the copies into your new hidden form; finally, just submit your hidden form.

    here’s a quick example that was cobbled together from some old code I have.


    An alternate approach

    Maybe you could combine an aspect of my approach with your code as it is today… You’ve already got your sub-forms in their own iframe — and that all works. The problem is that you need your sub-form data to get sent up along with your main form data.

    So you could use clone() as I described above — but in the opposite direction. When the update button is clicked, just clone() everything that’s inside your iframe, and dump it inside a hidden div that’s inside your main form. Then go ahead and let the form submit, taking all the data with it. Just make sure that your element names are unique across the two forms (since everything will eventually end up in the same form).

    Maybe something like this:

    $(function(){
       $('#item_edit').submit(function(){
           alert('try');
           var frmContents = $('iframe').first().contents().find('form > *').clone(true);
           var el = $('<div></div>');
           el.append( frmContents );
           el.css('display','none');
           $('#item_edit').append( el );
       });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.