Advertisement
Guest User

Wordpress plugin

a guest
Jul 8th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. And I have included a action for it:
  2. add_action( 'wp_ajax_the_ajax_hook_2', 'display_data_table' );
  3.  
  4. With the function that deals with database:
  5. function display_data_table(){
  6. $mno=$_POST['branch'];
  7. //.. more code
  8. }
  9.  
  10. Also my drop down menu html coding is:
  11. <select name="branch" id="sel_branch" >
  12. <option value="CSE">CSE</option>
  13. // more options..
  14. </select>
  15.  
  16. Now my jQuery script is like:
  17. jQuery(document).ready(function(){
  18. jQuery("#sel_branch").on('change', function(){
  19. var dropdown_id=$(this).val();
  20. jQuery.ajax({
  21. type : "post",
  22. url : the_ajax_script.ajaxurl,
  23. data : {
  24. action: "the_ajax_hook_2",
  25. branch : dropdown_id
  26. },
  27. success: function(response_from_display_data_table) {
  28. jQuery("#table_disp").html(response_from_display_data_table);
  29. }
  30. });
  31. });
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement