From 52f1f59583c384da73ab84a4f67fe6b4e48b7354 Mon Sep 17 00:00:00 2001 From: Priyanka Bhagwat Date: Wed, 27 Aug 2014 11:36:09 +0530 Subject: added clear button to search --- js/textbook_companion.js | 13 ++++++++++++- 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 .= "
  • Unable to propose particular book: Click here
  • "; $page_content .= "
  • Do not wish to propose any of the below books: Click here
  • "; $page_content .= ""; - $page_content .= "Search :"; + $page_content .= "Search : "; + $page_content .= ""; $page_content .= "
    "; $num_rows = mysql_num_rows($result); if ($num_rows > 0) { @@ -765,7 +766,8 @@ function textbook_companion_aicte_proposal_all() { $page_content .= "
    * Please select any 3 books from the below available list.

    "; $page_content .= "Unable to propose particular book: Click here

    "; $page_content .= "Do not wish to propose any of the below books: Click here

    "; - $page_content .= "Search :
    "; + $page_content .= "Search : "; + $page_content .= ""; $page_content .= drupal_get_form("textbook_companion_aicte_report_form"); $page_content .= drupal_get_form("textbook_companion_aicte_proposal_form"); return $page_content; -- cgit