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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:36:55+00:00 2026-05-25T01:36:55+00:00

I am trying to see how I can pass a dynamic input type through

  • 0

I am trying to see how I can pass a dynamic input type through serialize and be processed in my ajax php page for return via json. As you see, it is made up of a for loop which increments each input based on a slider. I cannot just process id=”BRV-brtrv-boxamount- because it dosen’t recognise it. I would be grateful if someone could help me with this. Thanks

for(var i = 0;i < $(this).val();i++) {
   $("#BRV-brtrv-boxnumber").append('<div data-role="fieldcontain"><label for="BRV-brtrv-boxamount" class="ui-input-text">Enter box ' + (i + 1) + ' number:</label><input type="text" name="BRV-brtrv-boxamount-' + i + '-no" id="BRV-brtrv-boxamount-' + i + '-no" class="BRV-brtrv-boxamount ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-a" required="required" /></div>')
   }

+++EDIT+++

$(function() {

 $("#BRV_brtrv").submit(function() {

   var send = $(this).serialize();

    $.ajax({
      type: "POST",
      url: "boxrtrvajax.php",
      cache: false,
      data: send,
      dataType: "json",
      success: function (msg) {

      $('#brtv-result').addClass("result_msg").html(msg.service);

     },
     error:function (xhr, ajaxOptions, thrownError){
      jAlert('There was an exception thrown somewhere');
      alert(xhr.status);
      alert(thrownError);
     }
   });
   return false;
  });
});
  • 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-25T01:36:56+00:00Added an answer on May 25, 2026 at 1:36 am
    var url = 'my.ajax.php';
    var params = new Object();
    
    $('input, select').each(function () {
      params[this.name] = this.value;      
    }); 
    
    $.post(url, params);
    

    since you provided a complete exemple, here is the complete answer:

    $(function() {
    
     $("#BRV_brtrv").submit(function() {
    
       var send = $(this).serialize();
    
       $.getJSON("boxrtrvajax.php", send, function(msg) {
          $('#brtv-result').addClass("result_msg").html(msg.service);
       })
       .error(function (xhr, ajaxOptions, thrownError) {
          jAlert('There was an exception thrown somewhere');
          alert(xhr.status);
          alert(thrownError);
       });
    
       return false;
      });
    
    });
    

    but your example shall work too. note: you can use $.post() instead of $.getJson() (or even $.get(), as both $.get and $.post are able to recognize and parse json response if there is one).

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

Sidebar

Related Questions

Im trying to use this page slider jquery plugin, you can see the demo
I am trying to see if i can pass a custom parameter to the
I am trying to see if the performance of both can be compared based
I am trying to see which button was clicked on so I can preform
For fun I am trying to see how far I can get at implementing
Trying not to lose it here. As you can see below I have assigned
I am trying to create 100 files using FileOutputStream/BufferedOutputStream. I can see the CPU
I'm trying to secure an application so that users can only see objects which
Trying to convert the following but am having difficulty. Can anyone see where I'm
I'm trying to show thumbnail images in Django admin, but I can only see

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.