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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:55:16+00:00 2026-06-01T04:55:16+00:00

I have a form that is populated with dynamic form elements based on a

  • 0

I have a form that is populated with dynamic form elements based on a “SecID” variable which identifies which section of the site the user is in.

I’m using classic ASP, with JQuery & AJAX to save the form changes. It’s working great so far with this code:

<form name="sampleForm" ID="sampleForm">
            <input type="hidden" name="SecID" id="SecID" value=<%=SecID%>>

            <input type="text" value="<%=rs.fields("Title")%>" name="Title" class="formJD">

            <input type="text" value="<%=rs.fields("JobCode")%>" name="JobCode" class="formJD">
            <select name="<%=TypeID%>-<%=RowID%>" class="<%=FormClass%>">
                        <option value="">Select</option>
                        <option value="1">Example 1</option>
                        <option value="2">Example 2</option>
            </select>
<%'***more form elements taken out to be short****%>
</form>

<script>


function showValues() {
  var str = $("#sampleForm").serialize();
                $.ajax({
                     type: "POST",
                     url: "updateFormAJAX.asp",
                     data: str,
                     success: function(msg) {
                        // $('#autosavenotify').text(msg);
                     }
                });

}

$(":checkbox, :radio").click(showValues);
$("select").change(showValues);
$("input").change(showValues);
showValues();
</script>

I’ll leave out the ASP page that is called by AJAX. This is all working fine to update the entire form on each change. The problem I’m having is that since I’m using serialize() to pass the elements to AJAX it’s saving the ENTIRE form with each change of a form element. This is ok for smaller pages, but some pages the form can be huge and saving the form 20+ times is going to slow things down.

What I’d like to do is just save individual form elements when they are changed instead of the entire form. I’ve tried to do that with a function like this:

<script>
    $(document).ready(function(){
    $('select').live('change',function () {
            var statusVal = $(this).val();
            //alert(statusVal);
            $.ajax({
                     type: "POST",
                     url: "saveStatus.asp",
                     data: "statusType=statusVal",
                     success: function(msg) {
                        // $('#autosavenotify').text(msg);
                     }
          })
      });
    });
    </script>

I had that working too, but I’m not sure how I can pass other variables to my AJAX update page that will be needed to save to the database. For example in the version I posted above I’m able to pass the “SecID” variable and since I’m using serialize() it will send everything. But if I only want to send a change to a single form element at a time, but also include the “SecID” variable or additional variables, how would I change this to accomplish it?

Thanks for any help!

  • 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-01T04:55:17+00:00Added an answer on June 1, 2026 at 4:55 am

    You could try:

    ...
    data: 'statusType=' + statusVal + '&otherKey=<%=otherVal%>',
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with many form elements that are not allways populated with
I have a ext.form.Combobox object that is dynamically populated by ext.data.JsonStore. The user can
I currently have form that checks if a user has unsubmitted changes when they
I have a form that contains a GridView control which is databound to an
I have a form drop down box (for the 50 states) that is populated
I have about 10 different objects that get populated from user input. Instead of
When a user is editing data in a form that is populated from a
I have a form that will be populated by a bunch of information from
I have a ListBox on a Windows Form that is populated during the Form_Load
I have a form that I'm looking at, which makes use of stored procedures

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.