Passing Classic ASP values in AJAX

I would like to tie this one off soon if we could.  On this page I am using an array to populate a datatable and I want to pass three values:
1) series id
2) age category
3) gender

The dropdowns are there.  I understand that this is not done via forms.  My dropdowns are:
1) series
2) categories
3) gender

I have learned a ton from this site on this but still having difficulty connecting these dots.

Thanks so much in advance.
Bob SchneiderCo-OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Your jquery would change to
$(document).ready(function() {
var series = 0;
var categories = 0;
var gender = 0;
$('#series').on('change',function(){
  series = $(this).val();
 });
$('#categories').on('change',function(){
  categories = $(this).val();
 });
$('#gender').on('change',function(){
  gender = $(this).val();
 });


    $('#standings').dataTable( {
        'ajax': '/series/results_array-new.asp?series_id='+series+'&gender='+gender+'&year=2014&age_to='+categories;
    } );
  
  
} );

Open in new window

0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Correction

$(document).ready(function() {
var series = 0;
var categories = 0;
var gender = 0;
$('#series').on('change',function(){
  series = $(this).val();
  categories = $('#categories').val();
  gender = $('#gender').val();
   getData(series,categories,gender);
 
 });
$('#categories').on('change',function(){
  series = $('#series').val();
  categories = $(this).val();
 gender = $('#gender').val();
 });
$('#gender').on('change',function(){
   series = $('#series').val();
   categories = $('#categories').val();
  gender = $(this).val();

 });

  function getData(series,categories,gender){
      // for testing
  alert (series+ ' '+gender + ' '+ categories);
   
      $('#standings').dataTable( {
        'ajax': '/series/results_array-new.asp?series_id='+series+'&gender='+gender+'&year=2014&age_to='+categories;
    } );
  

  
  }
  
  
} );

Open in new window

You can see the pop up sending values here http://jsbin.com/yaboro/2/edit
0
Bob SchneiderCo-OwnerAuthor Commented:
Thanks, but now how do I convert those in to asp variables on the "receiving" page?
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You already have the reviving page working.  On this page, you are simply sending data.   You had hard coded data and I converted it to use javascript variables.  Those variables are taken from the drop downs.
0
Bob SchneiderCo-OwnerAuthor Commented:
Sure, and this may be my ignorance, but the receiving page is drawing it's data from Request.Querystring.  Is that how this is being received?  I assume so but the page is now not rendering.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Looks like you are missing the function.  Note the code here http:Q_28509347.html#a40297150 and sample html http://jsbin.com/yaboro/2/edit that does not contain any javascript on the drop downs.
0
Bob SchneiderCo-OwnerAuthor Commented:
HI.  So I copied your code exactly as is and it appears to not be working.  Any ideas?
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Make sure you update the other html code.   Remember you have to take out the js in each of  your selects.  


 <select name="series" id="series" onchange="this.form.submit1.click();">
0
Bob SchneiderCo-OwnerAuthor Commented:
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Start validating your code   http://validator.w3.org/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I hope that worked for you.  When you start using more javascript, it is important to make sure your code is good as it can be the culprit for what could seem like unrelated js errors.
0
Bob SchneiderCo-OwnerAuthor Commented:
Yeah I see a lot of issues with the stuff I pulled down from some third parties as well so I will have to go through that more carefully.  But yes, your assistance helped a lot.  Once I get it "cleaned up" it will be a big help to this utility and to my learning curve with javascript, json, jquery, and ajax.

Thanks so much...
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
What you might want to do is recreate the table on a blank page and only deal with the 3 drop downs and table.  That takes all the other stuff out of it.  Once you get the test page to work, if it does not work on the live  page, you know it is the other stuff interfering.  That is how I would attack this.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AJAX

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.