Web Design and Development Forums

case sensitive

This is a discussion on "case sensitive" within the JavaScript Forum section. This forum, and the thread "case sensitive are both part of the Program Your Website category.

Old Apr 28th, 2008, 23:06   #1 (permalink)
 
Join Date: Jun 2007
Location: uk
Posts: 459
case sensitive

Hi

I know very little about javascript. I downloaded this script to search a database however it is case sensitive and only picks up anything from the database that starts with capital letter I type in the search box.

Is their anyway I can change the code so it is not case sensitive.

Cheers

Pat

Code: Select all
function createObject() {
    
    var request_type;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
    request_type = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        request_type = new XMLHttpRequest();
    }
        return request_type;
}

var http = createObject();

/* -------------------------- */
/* SEARCH                     */
/* -------------------------- */

function autosuggest() {
q = document.getElementById('search-q').value;

// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'lib/search.php?q='+q+'&nocache = '+nocache);
http.onreadystatechange = autosuggestReply;
http.send(null);
}
function autosuggestReply() {
if(http.readyState == 4){
    var response = http.responseText;
    e = document.getElementById('results');
    if(response!=""){
        e.innerHTML=response;
        e.style.display="block";
    } else {
        e.style.display="none";
    }
}
}

Last edited by CloudedVision; Apr 29th, 2008 at 03:18. Reason: [CODE] instead of [PHP] for the javascript
dab42pat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 29th, 2008, 03:17   #2 (permalink)
Nerdy Moderator
 
CloudedVision's Avatar
 
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 520
Blog Entries: 4
Re: case sensitive

All that script does is get the results from lib/search.php, so you'll have to mess around with that to fix it.
__________________
Take it easy

Other Road Design

WebForumz Moderator: HTML | Javascript | PHP
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 29th, 2008, 16:20   #3 (permalink)
 
Join Date: Jun 2007
Location: uk
Posts: 459
Re: case sensitive

Thanks Clouded, However the problem wasnt in javascript or PHP, It was in the database itself.

The field it was searching had its collation set to Latin1_bin so I changed it to utf8_unicode_ci the ci sort of gives it away case insensitive .

Anyway thanks for your help

Pat
dab42pat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
case : 'example' help jahphill PHP Forum 4 Nov 29th, 2007 19:43
Google PR Case sensitive? spinal007 Webforumz Cafe 8 Jun 11th, 2007 18:41
Problem with a switch case humnbird88 JavaScript Forum 2 Sep 5th, 2005 07:04
Equivalent of Select Case in Php ? Andy K PHP Forum 1 Aug 19th, 2005 08:21
PHP case & image help please charter PHP Forum 1 Jun 18th, 2004 17:38



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 19:15.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59