Hi all, here is my script i wrote (yet again, new to this, actually started this morning - 4am).
Code:
$(document).ready(function(){
$("#test").change(onSelectChange);
});
function onSelectChange(){
var dropDown1 = $("#test :selected").text()
$.ajax({
type: "GET", data: "pg=<?php echo $_GET['pg']; ?>&word=" + dropDown1, url: "php/php_ajax_input_script.php", cache: false, success:
function(html){
$("#ajaxDiv").html(html);
$("#test2").change(onSelectChange2);
}
});
}
function onSelectChange2(){
var dropDown2 = $("#test2 :selected").text()
$.ajax({
type: "GET", data: "pg=<?php echo $_GET['pg']; ?>&word=" + dropDown2, url: "php/php_ajax_input_script2.php", cache: false, success:
function(html){
$("#ajaxDiv2").html(html); }
});
}
//$("#updateContent").click( function() {
//var word = $("#word").value()
//alert('hghg')
//$.ajax({
// type: "GET", data: "pg=<?php echo $_GET['pg']; ?>&word=" + word + "&Name_value=" + nameValue, url: "php/php_ajax_input_script4.php", cache: false, success: function(html){
// $("#ajaxDiv4").html(html); }
// });
//});
The last function will not run. The button with the id "updateContent" is loaded in by the previous function with AJAX call.
Any ideas why it wont work would be greatfull