Previous Article Coding Source Editor with AJAX |
Ajax Tutorial: Dynamic Loading of ComboBox using jQuery and Ajax in ASP Classic |
Next Article Scrolling Page with ASP Classic And JQuery |
Coding Article #: 33 - Published On: February 01, 2012 @ 16:07:23 PM - Last Updated on: July 13, 2012
This article has been Favorited 32 timesJoin today, and add this to your favorites.
Share With Friends (Updated 6-8-2010)
This code was originally written September 2010, and was assisted from Experts Exchange Volunteer "leakim971".
Using AJAX And JQery, we take the values from the first Selection box and populate the 2nd selection box without refreshing the page.
This is done primarily by use of Jquery.
Live Demo«
Using AJAX And JQery, we take the values from the first Selection box and populate the 2nd selection box without refreshing the page.
This is done primarily by use of Jquery.
Live Demo«
<script type="text/javascript">
$(document).ready(function() {
$('#loader').hide();
$('#show_heading').hide();
$('#search_category_id').change(function() {
$('#show_sub_categories').fadeOut();
$('#loader').show();
$.get("ChildCats.asp", {
parent_id: $('#search_category_id option:selected').val()
}, function(response) {
//alert(response); // we alert the response first for testing purpose
setTimeout("finishAjax('show_sub_categories', '" + escape(response) + "')", 400);
});
return false;
});
});
function finishAjax(id, response) {
$('#loader').hide();
$('#show_heading').show();
$('#' + id).html(unescape(response));
$('#' + id).fadeIn();
}
function alert_id() {
if ($('#sub_category_id').val() == '')
alert('Please select a sub category.');
else
alert($('#sub_category_id').val());
return false;
}
</script>
Post to Facebook about: Ajax Tutorial: Dynamic Loading of ComboBox using jQuery and Ajax in ASP Classic