javascript - Passing values from one page to another and using value to filter table -



javascript - Passing values from one page to another and using value to filter table -

i passing 1 value search.php filtering.php. using $_get accomplish that. in filtering.php page have table auto filters based on word typed in input text box. passing value in url like: http://holaweblearning.co.nf/php_learning/filtering.php?key=dragoo. value url taken , placed in input text box. nil gets filtered unless click on text box , press key. how can pass value filtering.php page , result based on word? demo

i using footable filtering method

search.php

<div> <input type="text" class="search" placeholder="type 'dragoo' "> </div> <div> <a href="#" class="search_word">search</a> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $('.search').bind('change keyup', function() { var dinput = this.value; console.log(dinput); url='http://holaweblearning.co.nf/php_learning/filtering.php?key='+dinput; $('.search_word').attr('href', url); }); </script>

filtering.php

<?php $keyword = $_get['key']; ?> search: <input id="filter" type="text" value="<?php echo $keyword; ?>"/>

you through event listeners , come conclusion 'keyup' event responsible populating field. when page loads:

$('input#filter').trigger('keyup')

javascript jquery footable

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -