+ Start a Discussion

special character using sforce.connection.query in visualforce page

We have a custom field "check" of type Picklist.
If we execute query using ajax and using sforce.connection.query in the VF page using special character like

var query = Select Id, LastName, FirstName From Contact where Contact.check__c like 'sdds!&*()_+{}|:<>?/.;][%';
var result = sforce.connection.query(query);

it give an error faultstring (give an error due to parentheses, curly braces, and square braces) other wise it is working fine
In controller it is also working fine with any special character 
if we use any other field in place of "check__c" (or we can say other then picklist) then it is working fine for all the special character
can any one tell me how to execute this query properly for picklist type field(or how to handel parentheses, curly braces, and square braces for sforce.connection.query in the VF page)