Rozamunda
asked on
php/jquery architecture question
Hi,
I have a couple of dropdown selects on the main screen, where users can define their search criteria and submit the search to the database. The result is a multipage table of data which I am showing under my selections. Now, is it possible to submit this form asynchronously and refresh only the table area when the result comes back ? Any examples ? Snippets ?
I have a couple of dropdown selects on the main screen, where users can define their search criteria and submit the search to the database. The result is a multipage table of data which I am showing under my selections. Now, is it possible to submit this form asynchronously and refresh only the table area when the result comes back ? Any examples ? Snippets ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can collect the information from you form elements normally, or by using the val() method:
$('#my-select').val()
from there, you can pass variables with the 'data' property of the .ajax argument parameter object, and specify the method (get or post) with the 'type' property:
$('#my-select').val()
from there, you can pass variables with the 'data' property of the .ajax argument parameter object, and specify the method (get or post) with the 'type' property:
$.ajax({
url : path/to/your/script.php',
data : {
some_value : $('#my-select').val()
},
type : 'POST',
success : function(data){
$('#container').html(data);
}
});
// the php script would get $_POST['some_value'] set to the value of your dropdown
ASKER