Link to home
Start Free TrialLog in
Avatar of Rozamunda
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 ?
ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rozamunda
Rozamunda

ASKER

How should I collect all the input data from my dropdowns ?
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:
$.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

Open in new window