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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:27:28+00:00 2026-06-10T20:27:28+00:00

I am using jQuery to submit my form via AJAX. This updates a database

  • 0

I am using jQuery to submit my form via AJAX. This updates a database record and then returns a response for success or failure. The issue I am having is not critical but more for convenience.

When resetting a form it resets all the fields to their default values from when the page loads (for sake of simplicity.) This is not the behavior I want. The reason I want to change this is because if I submit the form and I then decide to change the value again then I decide I want to reset the form back to my last submitted values, it resets back to the initial defaults and not my new values that were recently submitted and saved in the database.

To try and better explain this I will show my process with the form field for a user’s username.

Username: SomeDefaultUserNameFetched

I then change the username to Foo.

Username: Foo

I submit the form via AJAX and get a success response.
I then decide maybe I don’t like Foo and would prefer Bar.

Username: Bar

Then I decide I don’t like Bar and Foo was just fine so I decide to reset the form.
Resetting the form will give me:

Username: SomeDefaultUserNameFetched

As you can see the form reset is not saving my recently submitted form data. So my question is how can I, if this is even possible, update the form defaults so that when I hit reset the form will reset the fields with my latest submission.

Thanks and I really hope someone can push me in the right direction or let me know if this is even possible.

UPDATE:
I would like to be able save this into the DOM if possible. Where are the default values stored at in the first place? I know I could modify my custom form reset to handle setting the form element values but I was trying not to have to cause this overhead if there was a way to update the DOM.

Thanks for the assistance

  • 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-10T20:27:29+00:00Added an answer on June 10, 2026 at 8:27 pm

    Found Solution:
    I found this: http://www.w3schools.com/jsref/prop_text_defaultvalue.asp as my solution. By looping through my submission content I can update the default values as they are changed.

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

Sidebar

Related Questions

i'm using ajax form jquery plugin to submit a form (in a dialog) via
I'm using the jQuery plugin ajaxForm to submit a file upload form via AJAX.
I am using following jQuery code to submit a form via AJAX. jQuery('form.AjaxForm').submit( function()
I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
When using the jQuery submitHandler method, I'm posting the form data via ajax to
I have a form using jquery validation plugin. My submit button has an ajax
I am submitting a form via jquery form submit. just like this example However,
I am using this plugin: http://malsup.com/jquery/form/#getting-started I am having issues, getting it to submit
I'm using a click function on a link to submit the form via ajax,

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.