php - JavaScript search script not working in Internet Explorer? -


i've following search script doesn't seem working @ in ie. comes "sorry, couldn't find using search criteria..." error.

the code follows:

<?  $getmystatus = mysql_query("select status members id = '$session_memberid'"); while($getmys = mysql_fetch_array($getmystatus)) { $mystatus = $getmys['status']; }   ?>  <script language=javascript>  function search() {  var snum = 0;  var name = $("#search_name").val(); var city = $("#search_city").val(); var country = $("#search_country").val(); var jobtitle = $("#search_jobtitle").val(); var company = $("#search_company").val(); var minage = $("#search_minage").val(); var maxage = $("#search_maxage").val(); var industry = $("#search_industry").val(); var male = $('#search_male').is(':checked');  var female = $('#search_female').is(':checked'); var token = $("#mtoken").val();  if(!city) { city = ''; } else {} if(!country) { country = ''; } else {} if(!jobtitle) { jobtitle = ''; } else {} if(!company) { company = ''; } else {} if(!minage) { minage = '0'; } else {} if(!maxage) { maxage = '0'; } else {} if(!industry) { industry = ''; } else {}   if ( name != '' ) { snum = snum+1; } if ( city != '' ) { snum = snum+1; } if ( country != '' ) { snum = snum+1; } if ( jobtitle != '' ) { snum = snum+1; } if ( company != '' ) { snum = snum+1; } if ( minage != '0' ) { snum = snum+1; } if ( maxage != '0' ) { snum = snum+1; } if ( industry != '' ) { snum = snum+1; }  if ( male == true ) { snum = snum+1; } if ( female == true ) { snum = snum+1; }  if ( snum < 1 ) {  $('#sverif').html('<font color=red>select al least 1 type</font>');  } else {  $('#searchres_nresults').hide().html("<table border='0'><tr><td><img width=60 src='/images/loading.gif'></td><td>searching ..</td></tr></table> ").fadein(); $('#sverif').html('');  var datastring = "token="+token+"&name="+name+"&city="+city+"&country="+country+"&jobtitle="+jobtitle+"&company="+company+"&minage="+minage+"&maxage="+maxage+"&industry="+industry+"&male="+male+"&female="+female;          $.ajax({             type: "post",             url: "ajax/ajsearch.php",             async: true,             data: datastring,              success: function(data) {                  $("#searchres_results").html(data);                 $("#searchres_results").css("display","block");                 var snresnum = $("#searchresults_number").html();                 if ( snresnum == '0' ) {                      $("#searchres_nresults").delay(3000).html("<div class=t23>sorry, couldn't find using search criteria...</div>");                  } else {                      $("#searchres_nresults").delay(3000).html("<div class=t23>great news, we've found "+snresnum+" people...</div>");                  }              }          });   } </script> 

the html form expected won't include apart last submit button in case helps:

<div class="profilebutton" onclick="search();">search</div> <div class="boxleft" id='searchres_results' style='display:none;'> </div> 

for sorry, couldn't find using search criteria... outputted need reach line of code. means snresnum == '0' true.

this because set:

var snresnum = $("#searchresults_number").html(); 

and $("#searchresults_number").html() '0'.

be sure value inside element id="searchresults_number" generated correctly in ajsearch.php. 0 now.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -