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

  • SEARCH
  • Home
  • 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 8280103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:32:59+00:00 2026-06-08T09:32:59+00:00

EDIT: I simplified the example to use text inputs. Same error. Form fails to

  • 0

EDIT: I simplified the example to use text inputs. Same error. Form fails to submit when an input is removed from the form.
EDIT: Duplicated in Firefox 14. Chrome does not have same behaviour.

I have a multiple file upload form with jquery to add and remove file input elements from the form. If I remove one of the inputs the form.submit() function does not proceed. Below is simplified code using “text” inputs. And a Fiddle at http://jsfiddle.net/carbontax/rMMuE/

    <form id="form-foo" method="POST">
        <div id="input-container-container">
       </div>
    </form>
    <input type="button" id="add-text-input" value="ADD TEXT INPUT">
    <input type="button" id="submit" value="SUBMIT">

Script

    $('#submit').click(function() {
        $('#form-foo').submit();
    });

    $("#add-text-input").click(function() {
        var div = $('<div/>', {
            'class': 'input-container'
        }).append($('<button/>', {
            'class': 'delete-text-input',
            html: "X"
        }));
        var input = $('<input/>', {
            type: 'text',
            name: 'texts',
            'class': 'input-text'
        }).appendTo(div);
        div.appendTo($('#input-container-container'));
    });

    $('#form-foo').on('click', 'button.delete-text-input', function(e) {
        e.preventDefault();
        $(this).closest('div').remove();
    });
  • 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-06-08T09:33:01+00:00Added an answer on June 8, 2026 at 9:33 am

    Satya Teja had a helpful suggestion to put the submit button inside the form, but I don’t know why it works. In my case I need to submit the form indirectly, based on the outcome of another event. So here is the solution.

    HTML: add a hidden submit button inside the form

        <form id="form-foo" method="POST">
            <div id="input-container-container">
           </div>
           <!-- workaround to allow submit after deleting a form element -->
           <input type="submit" id="form-foo-submit" style="display: none"/>
        </form>
        <input type="button" id="add-text-input" value="ADD TEXT INPUT">
        <input type="button" id="submit" value="SUBMIT">
    

    Script. Instead of calling submit() on the form, call click() on the hidden submit button. Works in Firefox, Chrome and even IE6

        $('#submit').click(function() {
            // Instead of calling $('#form-foo').submit()
            $('#form-foo-submit').click();
        });
    
        $("#add-text-input").click(function() {
            var div = $('<div/>', {
                'class': 'input-container'
            }).append($('<button/>', {
                'class': 'delete-text-input',
                html: "X"
            }));
            var input = $('<input/>', {
                type: 'text',
                name: 'texts',
                'class': 'input-text'
            }).appendTo(div);
            div.appendTo($('#input-container-container'));
        });
    
        $('#form-foo').on('click', 'button.delete-text-input', function(e) {
            e.preventDefault();
            $(this).closest('div').remove();
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: iam using ajax to load text in my content that is why onload
I have 2 buttons. I am trying to use event from button 1 into
This is a simplified example, but I am working on a code translator that
Consider the overly simplified example below; some of it written with pseudocode for brevity.
Can I match and replace a text pattern in a MYSQL select? EDIT For
Given the example queries below (Simplified examples only) DECLARE @DT int; SET @DT=20110717; --
Edit: after much fiddling, it seems urlgrabber succeeds where urllib2 fails, even when telling
Here is a simplified example of what I am trying to achieve; <asp:CheckBox runat=server
I've simplified my example here massively, so please excuse it if it looks to
EDIT in accordance with @Will suggestions here is a simplified question... Is there a

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.