diff options
author | Priyanka Bhagwat | 2014-08-27 11:36:09 +0530 |
---|---|---|
committer | Priyanka Bhagwat | 2014-08-27 11:36:09 +0530 |
commit | 52f1f59583c384da73ab84a4f67fe6b4e48b7354 (patch) | |
tree | 1b1b9a789d50a0d4c866d4369da88026da4ea869 | |
parent | df9fdd922042f17ddd0231e7a3df807374c715db (diff) | |
download | scilab_textbook_companion-52f1f59583c384da73ab84a4f67fe6b4e48b7354.tar.gz scilab_textbook_companion-52f1f59583c384da73ab84a4f67fe6b4e48b7354.tar.bz2 scilab_textbook_companion-52f1f59583c384da73ab84a4f67fe6b4e48b7354.zip |
added clear button to search
-rwxr-xr-x | js/textbook_companion.js | 13 | ||||
-rwxr-xr-x | textbook_companion.module | 6 |
2 files changed, 16 insertions, 3 deletions
diff --git a/js/textbook_companion.js b/js/textbook_companion.js index 660ccdf..070e960 100755 --- a/js/textbook_companion.js +++ b/js/textbook_companion.js @@ -1,5 +1,5 @@ $( document ).ready(function() { - +//to search $('#searchtext').keyup(function(event) { var search_text = $('#searchtext').val(); var rg = new RegExp(search_text,'i'); @@ -20,6 +20,17 @@ $( document ).ready(function() { } }); }); + + //to clear the searched text + $('#search_clear').click(function() { + $('#searchtext').val(''); + $('#aicte-list-wrapper .title , .form-item' ).each(function(){ + $(this).parent().css('display', ''); + $(this).css('display', ''); + $(this).next().css('display', ''); + $(this).next().next().css('display', ''); + }); +}); $('#edit-same-address').click(function() { diff --git a/textbook_companion.module b/textbook_companion.module index 1a7c96c..ca73636 100755 --- a/textbook_companion.module +++ b/textbook_companion.module @@ -697,7 +697,8 @@ function textbook_companion_aicte_proposal_all() { $page_content .= "<li>Unable to propose particular book: <a id='aicte-report' href='#'>Click here</a></li>"; $page_content .= "<li>Do not wish to propose any of the below books: <a id='aicte-report' href='http://fossee.in/feedback/scilab-aicte' target = _blank>Click here</a></li>"; $page_content .= "</ul>"; - $page_content .= "Search :<input type='text' id='searchtext' style='width:90%'/>"; + $page_content .= "Search : <input type='text' id='searchtext' style='width:82%'/>"; + $page_content .= "<input type='button' value ='clear' id='search_clear'/>"; $page_content .= "<div id='aicte-list-wrapper'>"; $num_rows = mysql_num_rows($result); if ($num_rows > 0) { @@ -765,7 +766,8 @@ function textbook_companion_aicte_proposal_all() { $page_content .= "<h5><b>* Please select any 3 books from the below available list.</b></h5></br>"; $page_content .= "Unable to propose particular book: <a id='aicte-report' href='#'>Click here</a></br></br>"; $page_content .= "Do not wish to propose any of the below books: <a id='aicte-report' href='http://fossee.in/feedback/scilab-aicte' target = _blank>Click here</a></br></br>"; - $page_content .= "Search : <input type='text' id='searchtext' style='width:90%;'/></br>"; + $page_content .= "Search : <input type='text' id='searchtext' style='width:82%'/>"; + $page_content .= "<input type='button' value ='clear' id='search_clear'/>"; $page_content .= drupal_get_form("textbook_companion_aicte_report_form"); $page_content .= drupal_get_form("textbook_companion_aicte_proposal_form"); return $page_content; |