[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

search not working when apostrophe is used

Posted on 2004-10-01
12
Medium Priority
?
314 Views
Last Modified: 2013-12-18
I search the info based on name. I get the name from the user thru a form which has the following code
I have a field "emp_search" to get the value.

<script language="JavaScript">
function empsearch(form){
var query = form.emp_search.value+"*";
var href = form.dbpath.value + "/Searchemployee?SearchView&query=[LastName]="+query+"&SearchOrder=4";
location.href=(href);
}
</script>

and the Searchemployee view is like this
lastname                value
abella            <script> var color=((2%2)==1)? 'eeeeee':"#ffffff";  document.write       ('<table width=100% border=0 cellpadding=2 cellspacing=0 bordercolor=dddddd align=center><tr bgcolor='+color+'><td class="results" width=40%>Abella, Gabriel</td><td class="results">713-767-4712<td align="right">
<a href="/dynintranet/phonelist.nsf/Searchemployee/5D4E69C0237C6A0A86256DF200740D0D" class="results2">more...</a></td></tr></table>'); </script></td></tr></table></TD></TR>


this view has details for all the last name.

The problem is when I give the last name with apostrophe it is not searching. eg if I give O'Meara it is not searching.

How can I avoid this?

Please help me.


Thanks in advance

0
Comment
Question by:AboutLotus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +3
12 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12200721
Include double qoutes around query

eg:

var href = form.dbpath.value + "/Searchemployee?SearchView&query=[LastName]=\""+query+"\"&SearchOrder=4";


~Hemanth
0
 

Author Comment

by:AboutLotus
ID: 12201345
Hey I tried that too but its not working.
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 12201452
You must use the translated codes in your script, eg. %20 for space.

I can't tell you what ' is from the top of my head, but I'm sure you'll be able to find it somewhere....

cheers,

Tom
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 15

Expert Comment

by:Bozzie4
ID: 12201473
Ok , try %27 .

var href = form.dbpath.value + "/Searchemployee?SearchView&query=[LastName]=\"O%27Meara\"&SearchOrder=4";

cheers,

Tom
0
 

Author Comment

by:AboutLotus
ID: 12201513
I tried %27 and it is not working still.

Please help me with this.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12201523
try this:

var href = form.dbpath.value + "/Searchemployee?SearchView&query=[LastName]="+unescape(query)+"&SearchOrder=4";

Partha
0
 

Author Comment

by:AboutLotus
ID: 12201593
This is also not working
0
 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 80 total points
ID: 12202147
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12228515
A workaround: change all of your docs so that a new field for searching is added

  FIELD LastNameEncoded := @URLEncode( "Domino"; LastName );

Then change the query so that it looks inside LastNameEncoded

0
 
LVL 31

Accepted Solution

by:
qwaletee earned 120 total points
ID: 12229385
Even in Notes you can't search on apostraphe.  There's really no workaround.  Oddly, you can't even search for, say O'Keefe, using "o*keefe" or "o keefe" -- it does not get treated as two words (space in middle) or one word (wild card in middle).  But the keefe part is in fact treated as a single word, so you could search for just keefe, or "[lastname=(o and keefe)"
0
 

Author Comment

by:AboutLotus
ID: 12235466
Hey guys thanks a lot for all who have taken pain in answering my ques.

Thanks
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12272530
NOTE

the problem described in this question is NOT an issue for my notes system (using Notes 6.5.1)... ie I can search for an apos with total control without any problem, and I tested it both remotely through the web browser and locally in the notes client!!

For example,
the document with title like                           is found when searching         hits
-------------------------------------------------------------------------------------------------
11'09''01 - September 11 (2002)                   [title]=''                                1
Rosemary's Baby (1968)                               [title]='                                 60
Buffalo '66 (1998)                                        [title]='66                              2
Matrimonio all'italiana (1964)                        [title]=all'italiana                    1


---
Just for posterity,

my formula in comment #12228515 is wrong. This one works instead:
  FIELD LastNameEncoded := @ReplaceSubstring( LastName; {'}; "_" );
and when searching for something with an apos, do the same substitution and look inside the LastNameEncoded field.
---

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question