Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1025311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:54:33+00:00 2026-05-16T11:54:33+00:00

i have the following code for search from database show return result to the

  • 0

i have the following code for search from database show return result to the page and show them with jqgrid, my code works fine with firefox but its not work on ie, when i use of utf8
like arabic letters, i set both of encoding of ie, and firefox to unicode(utf8)

its html code

first name: <input type="text" id="firstname" onkeydown="doSearch(arguments[0]||event)" value="" class="mytextbox" /> 

<button onclick="gridReload()" id="submitButton" style="margin-right:100px;" class="Buttons">search</button> 

my javascript code

function gridReload(){ 
    var name = jQuery("#firstname").val();

jQuery("#list2").jqGrid('setGridParam',{url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="+firstname",page:1}).trigger("reloadGrid");

}

and my php code

if(isset($_GET["firstname"]))
 $firstname = $_GET['firstname'];

mysql_query ( "set names utf8" );

if($firstname!='')
 $where= "  firstname LIKE '$firstname%'"; 

$SQL = "SELECT id,firstname,lastname FROM  mytable ".$where." 
     ORDER BY $sidx $sord LIMIT $start , $limit";

 $result = mysql_query( $SQL ) or die(mysql_error());
$responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
 $i=0;
 while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { 
     $responce->rows[$i]['id']=$row[id];
     $responce->rows[$i]['cell']=array(
     $row[id],$row[firstname],$row[lastname]);
     $i++; 
     }

 echo json_encode($responce); 

why its not work with ie(i teste with ie8) but works with opera and firefox

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:54:34+00:00Added an answer on May 16, 2026 at 11:54 am

    First of all you have problem with quotes in the line where you use setGridParam. Probably you mean

    jQuery("#list2").jqGrid('setGridParam',
        {url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="+firstname,
         page:1}).trigger("reloadGrid");
    

    instead of

    jQuery("#list2").jqGrid('setGridParam',
        {url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="+firstname",
         page:1}).trigger("reloadGrid");
    

    It seems to me not good to build url with this code. You should at least use something like

    jQuery("#list2").jqGrid('setGridParam',
        {url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="
             +encodeURIComponent(firstname),
         page:1}).trigger("reloadGrid");
    

    or

    jQuery("#list2").jqGrid('setGridParam',
        {url:"<?php bloginfo('template_url'); ?>/post2.php?"+
             jQuery.param({firstname: firstname}),
         page:1}).trigger("reloadGrid");
    

    Then any international characters from the firstname will be encoded correctly in the url.

    One more way is the usage of postData parameter of the jqGrid. See How to filter the jqGrid data NOT using the built in search/filter box for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.