Jump to content

'Live, As-You-Type Search' With a twist?


ladladding

This topic is 2767 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hello Guys!

 

I've been using this script: http://filemakerinspirations.com/2009/10/live-as-you-type-search-in-filemaker/ for a while now but have recently had a client that has asked:

 

"I like the 'live as you type search' but can we have so that it only filters down exact searches?"

 

For example with the above script if your start type 'Ma' you will get the following:

  • Mart
  • Martin
  • Amazing
  • Martian
  • Email

Instead he would like just result that start with 'Ma' so when he searches he would only get the following results:

  • Mart
  • Martin
  • Martian

Is there a way of modifying this script? If so it would greatly appreciated if you could advise how!

 

Thank!

 

LL

Link to comment
Share on other sites

  • Newbies

Hello Comment,

 

Thanks for your reply, yes the script above does seem to give the results I mentioned above, (if you start to 'Ma' it will show any instance where 'Ma' is part of the string, such as 'Mat, Amazing, Mark, Emma' etc,.).

 

What I would like is when I type 'M' it just show results that start with 'M' then if I type 'Ma' it will just show words that start with 'Ma' not contain.

Link to comment
Share on other sites

The default Filemaker find searches for "words that start with [...]".  The search phrase "Ma" does NOT find "Amazing".

 

If "Amazing" is found as the result of entering "Ma" as the search phrase, your script must be adding wild cards to the search phrase before performing the find. I don't see that the script you have linked to does that.

Link to comment
Share on other sites

  • Newbies

I've just had a look and I think I have mistaken myself and given the wrong examples! 
 
When I type 'Ma' it brings up the following result

  • Martin
  • Martian
  • Dr Martin
  • Mr Marcus

What I would like is for just words/strings that start with 'Ma', so just:

  • Martin
  • Martian

And not 'Dr Martin' or 'Mr Marcus' etc,.

 

I'm guessing I would need it to ignore spaces when searching through the records somehow?

 
Sorry my previous examples where completely wrong in explaining what I was after!
 
The script I'm using is a follows:

 

Untitled.png

 

Once again sorry for the wrong examples in what I'm after!

Link to comment
Share on other sites

  • Newbies

 

IIUC, you want to find only records where the field starts with [...]. For this, set the searched field to:

"==" & $thisterm & "*"

 

Ah! Perfect! Works like a charm!

 

Thank you for your help and once again sorry not explaining myself properly!

Link to comment
Share on other sites

  • 2 years later...

This topic is 2767 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.