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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:03:37+00:00 2026-06-04T12:03:37+00:00

I have a simple non-Ajax form that presents serialized fields for saving a whole

  • 0

I have a simple non-Ajax form that presents serialized fields for saving a whole bunch of pieces of data across multiple records i.e. a quote with multiple line items and each field on each line is editable.

The form needs to be saved before being submitted and I would love for the form’s submit button to say SAVE CHANGES (done by a URL to my quasi-controller) if the form is edited, and otherwise say SUBMIT TO CLIENT, if unedited.

I’m looking into AJAX, but am wondering if it is overkill for this situation.

Any help is appreciated.

  • 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-04T12:03:38+00:00Added an answer on June 4, 2026 at 12:03 pm

    AJAX is overkill if all you want is to change the wording on the button. If clicking ‘SAVE CHANGES’ submits the form as normal (then loads the form again with the default ‘SUBMIT TO CLIENT’?) then you won’t need it.

    What you want is plain javascript. Have an onchange event handler tied to each field that changes the text of the button. It could also change other aspects of the form (such as a hidden ‘data_changed’ field) so your controller knows to save the data instead of submitting it.

    If no changes occur, the button will remain as ‘SUBMIT TO CLIENT’.

    Am I on track with this answer? Do you need to ‘SAVE CHANGES’ in place without submitting the form? Or would you like more details on how to achieve this?

    EDIT: sample code added

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>Save vs Submit Example</title>
    <script type="text/javascript">
    
    onchange_handler = function ( event ) {
        var form_modified = document.getElementById("form_modified");
        var form_submit = document.getElementById("form_submit");
    
        form_modified.value = "true";
        form_submit.value = "Save Changes";
    }
    
    </script>
    </head>
    <body>
    <form method="post">
    
    <input name="quote_number" type="text" onchange="onchange_handler()" />
    <input name="quote_date" type="text" onchange="onchange_handler()" />
    
    
    <input name="line_number" type="text" onchange="onchange_handler()" />
    <input name="line_product" type="text" onchange="onchange_handler()" />
    <input name="line_quantity" type="text" onchange="onchange_handler()" />
    
    <input name="form_modified" id="form_modified" type="hidden" value="false" />
    <input type="submit" id="form_submit" value="Submit to Client" />
    
    </form>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple win service, that executes few tasks periodically. How should I pass
I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input
I have simple SSIS package which reads data from flat file and insert into
I have simple SSIS package where I import data from flat file into SQL
I have simple WinForms application where modifying Windows Registry. The problem is that in
i have simple singleton that sets pdo object from factory class , in the
I have a simple question: given p points (non-collinear) in R^p i find the
I have a simple little table (just 8 fields) an hour ago I rebuilt
I have an admin that is almost completely ajax driven. When the page loads
Let`s suppose we have a simple (non-assoc) array with 100001 values and these values

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.