Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- And I have included a action for it:
- add_action( 'wp_ajax_the_ajax_hook_2', 'display_data_table' );
- With the function that deals with database:
- function display_data_table(){
- $mno=$_POST['branch'];
- //.. more code
- }
- Also my drop down menu html coding is:
- <select name="branch" id="sel_branch" >
- <option value="CSE">CSE</option>
- // more options..
- </select>
- Now my jQuery script is like:
- jQuery(document).ready(function(){
- jQuery("#sel_branch").on('change', function(){
- var dropdown_id=$(this).val();
- jQuery.ajax({
- type : "post",
- url : the_ajax_script.ajaxurl,
- data : {
- action: "the_ajax_hook_2",
- branch : dropdown_id
- },
- success: function(response_from_display_data_table) {
- jQuery("#table_disp").html(response_from_display_data_table);
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement