Software developers using
jQuery search
for various occasions. This tutorial is based on zend framework template system.
index.phtml
<h4 class=”search” >Search .
<table border=”0″ cellspacing=”4″>
<tr><td>Society Name</td><td width=””><input type=”text” name=”society_name” id=”society_name” style=”width: 155px”></td>
<td>Created on</td><td width=””><input type=”text” name=”added_on” id=”added_on” style=”width: 155px”>
<script type=”text/javascript”>
$(‘#added_on’).datepicker({
dateFormat: “yy/mm/dd”,
beforeShowDay: $.datepicker.noWeekends
});
</script></td></tr><tr><td></td>
<td width=”120″><input type=”button” id=”search-societies_0″ value=” Go ” class=”alt_btn search-societies”>
<input type=”button” id=”searchclear_0″ value=” Reset ” class=”alt_btn search-societies-clear”>
</tr></table></h4>
<div id=”society-list”> </div>
———————————————————————————————————————————-
<script>
//Search societies start here.
$(“.search-societies”).live(“click”, function(){
var id =$( this ).attr(“id”).split(‘_’);
var society_name = $.trim($(“#society_name”).val());
var added_on = $.trim($(“#added_on”).val());
var oSocietiessearch = new Object();
oSocietiessearch.society_name = society_name;
oSocietiessearch.added_on = added_on;
$(“#society-list”).load(sBaseUrl + “/admin/pollsocieties/societylist”, oSocietiessearch);
}); //Search societies end here.
//Search society clear
$(“.search-societies-clear”).live(“click”, function(){
var id =$( this ).attr(“id”).split(‘_’);
$(“#society_name”).val(”);
$(“#added_on”).val(”);
$(“#society-list”).load(sBaseUrl + “/admin/pollsocieties/societylist”);
}); //Search society clear ends here.
</script>