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 1013035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:02:11+00:00 2026-05-16T10:02:11+00:00

I need to trigger a form submit event when any form value changes and

  • 0

I need to trigger a form submit event when any form value changes and all the fields in the form are filled. Everything in this works apart from the $('#date_filter_form').submit(); line. I can .hide() the form but can’t submit() it for some reason. Documentation says submit() is the same as trigger(‘submit’) so I can’t figure out why it wouldn’t be working.

$('#date_filter_form input[type="text"]').change(function() {
    var from_val = $('#date_filter_form #from_date').val();
    var to_val = $('#date_filter_form #to_date').val();
    if(from_val != '' &&  to_val != '') {
        $('#date_filter_form').submit();
    }
});

HTML:

<form method="post" id="date_filter_form" name="date_filter_form" action="">
   <label class="left required" for="from_date">From</label>
   <input type="text" id="from_date" class="datepicker hasDatepicker" value="" name="from_date">
   <label class="left required" for="to_date">to</label>
   <input type="text" id="to_date" class="datepicker hasDatepicker" value="" name="to_date">

    <input type="hidden" value="" name="from_date_db">
    <input type="hidden" value="" name="to_date_db">

    <input type="submit" id="submit" class="button" value="Show results" name="submit">
</form>
  • 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-16T10:02:11+00:00Added an answer on May 16, 2026 at 10:02 am

    Your submit button is named 'submit', and it clashes with the form.submit method.

    This happens because browsers provide shortcut accessors to form elements, properties that refer to the elements, are bound to the form element, using the name attribute as the property name.

    An element named submit will replace the form.submit method, you should simply change name.

    Also keep in mind that in IE you will have the same problems with the id attribute.

    See also:

    • Form Access – The Most Common Mistake

    The most common mistake made when defining the form HTML that a script will interact with follows from the existence of the shortcut accessors for form controls. It is to give the control a NAME (or possibly ID) that corresponds with an existing property of FORM elements. And the most common example of that is an INPUT element of type=”submit” with the NAME “submit”. Because the named controls are made available as named properties of the FORM element this INPUT element is made available under the property name “submit”. Unfortunately FORM elements already have a property with the name “submit”, it is the submit method that can be used to submit the form with a script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create Trigger for delete action which backsup all fields old value
I need to submit a form which triggers a workflow that goes through different
I need to trigger an event when the user drops a marker on the
I'm having a really difficult time understanding how this all works together. I've fiddled
This is what I got: <form method=post id=myform class=myform> <input type=submit onclick=return claim(); name=submit
I have this tag in a php string: <input type=submit name=op id=edit-submit value=Log in
I have got two buttons, which both submit a form in asp.net. I need
After validate I need to trigger custom submits on different hidden buttons. Code works
I need to trigger function bar() whenever function foo() fires. I have no control
I need to trigger an executable file(built using .net) using the command prompt. For

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.