Jump to content
Server Maintenance This Week. ×

search not working on one field


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

Recommended Posts

Using a pop-up selection I can not get the search to do what we want.

For example: A publication is either a) English, : French or c) English/French

When the option for English publications is selected, we want to show all the a) English publications and c) English/French publications. (in other word search the field for all publications that contain english)

Currently here is the code:

<select name="LV PLID_Sort::PubLanguage_E" size="1">

<option></option>

<option value="English">English / Anglais</option>

<option value="French">French / Francais</option>

<option value="Other">Other / Autre</option>

</select> -->

When the selection English is picked - we get the English only pubs not the English/French pubs.

When searching in FMPro (rather than CDML on the web) we search the field and get both.

What am I missing and why wont it work from the web.

Other fields in the form seach fine.

Link to comment
Share on other sites

It doesn't make sense. CDML uses webcompanion, and webcompanion performs everything in FileMaker in the same manner as you would do it yourself. FileMaker is really good in that you can perform a find with English and anything that CONTAINS English will be found. CDML is the same way. You should get back English/French when you search for English.

What is your rest of your code?

Is it:

<form method="post">

<input type="hidden" name="-db" value="databasename"/>

<input type="hidden" name="-lay" value="layoutname"/>

<input type="hidden" name="-format" value="html page that will display the results"/>

<select name="LV PLID_Sort::PubLanguage_E" size="1">

<option></option>

<option value="English">English / Anglais</option>

<option value="French">French / Francais</option>

<option value="Other">Other / Autre</option>

</select>

<input type="submit" name="-find" value="find records"/>

The only thing it could be is that somehow, i haven't really dealt with cdml in a while so I don't know, but maybe finds don't function correctly with relationship fields. Probably not though. Also, look at the html page that displays the results. Is there anything wrong with the cdml on that page?

Good luck,

Justin Grewe

Link to comment
Share on other sites

Here is what I have in addition to the pop-up selection:

<form action="FMPro" method="POST" name="searchform">

<input type="hidden" name="-token" value="[FMP-currenttoken]">

<input type="hidden" name="-DB" value="PUB_Publication_.fp5">

<input type="hidden" name="-LAY" value="ForWeb">

<input type="hidden" name="-format" value="hitlist.html">

<input type="hidden" name="-error" value="search.html">

<input type="hidden" name="-find" value="">

<input type="hidden" name="-script" value="Web_CheckFind">

<input type="hidden" name="-LOP" value="AND">

then... (Pop-up selections...)

<input class="button2" type="submit" name="Search" value="Search">

I am wondering if there might be some trouble with seaching on the field. Are there any settings from the Filemaker database side that might cause the field to search for exact rather than contains?

Link to comment
Share on other sites

mlindal,

I don't understand your cdml and I don't know why it's working myself at the current moment. You should just have

<form action="fmpro" method="post" name="searchform">

<input type="hidden" name="-db" value="PUB_Publication_.fp5"/>

<input type="hidden" name="-lay" value="ForWeb"/>

<input type="hidden" name="-token" value="[FMP-currenttoken]">

<input type="hidden" name="-format" value="hitlist.html"/>

<select name="LV PLID_Sort::PubLanguage_E" size="1">

<option></option>

<option value="English">English / Anglais</option>

<option value="French">French / Francais</option>

<option value="Other">Other / Autre</option>

</select>

<input type="submit" name="-find" value="find records"/>

The find request is not a hidden type in the form. It goes with the submit button. You don't need a script in FileMaker to do the finds. Although, you might be using the script for other reasons. But you don't need the LOP AND in there I do not think. If all you are doing is just a simple find as you have described than just use my form and it will work. Also, the last input you have where there is button2, What is that doing?? to me that is doing nothing. If you had a php page and you were posting data onto a php page, then all you would need is a input type="submit" name="submit" or search as you have done, but with the FileMaker webcompanion CGI, you need to be specific at what you want it to do once you hit the submit button. Currently, search does nothing in FileMaker. Stick with -find.

Good luck,

Justin Grewe

Link to comment
Share on other sites

I would remove this line:

<input type="hidden" name="-LOP" value="AND">

you could have this line before the <select>:

<input type="hidden" name="-OP" value="cn">

This will use the "contains" search. (I don't know exactly what your data looks like so this may not be appropriate.)

This is OK:

<input type="hidden" name="-find" value="">

because it caters for anybody just pressing the enter key rather than clicking on the "Submit" buton. However, you should still have:

<input type="submit" name="-find" value="Search">

Good Luck.

Garry

Link to comment
Share on other sites

Success!

It works! The keys changes needed were

1. Taking out the "-LOP" value="And"

2. Fixing the submit button so the name="-find" <!-- pretty dumb oversight on my part -->

3. this one may not be necessary - but... adding <input type="hidden" name="-OP" value="cn">

before the <select>

To answer the question from Justin about "button2" - that is a CCS style that I use to make the submit button look cool under most browsers. Unfortunately it doesn't do a thing under Apple's Safari - but works great under Explorer.

Thanks guys - some quick advice and I am back on track!

The next phase will be to convert the whole site to XML so we can use FM7...

Link to comment
Share on other sites

Back to square 1...

The search now only partly works.

Searching for "English" finds results that start with 'english' (ie. English, English/French, etc)

And search for 'French' will find results starting with 'French' (ie. French, French/English), however it will not find 'English/French' ...

Any more thoughts on what else can be done. It should work - but I am now thinking that I may need to do some work on the database field itself. Please provide input if you can.

Link to comment
Share on other sites

Here is the answer:

The '/' was messing up the searching with the Filemaker database.

Ie) a publication was 'English/French' and the '/' was causing the indexing to go funny...

When we changed the value list to 'English / French' (spaces around the '/') it works fine and finds the publications we needed.

Thanks to all for you input.

Link to comment
Share on other sites

Yeah, I believe FM only searches the beginning of words, not embedded strings. In our web search engines, we tell people they can use partial words but I think they're used to typical web search formats (whole words, +, -, " ", etc.). FM also has reserved characters that can complicate searches.

--ST

Link to comment
Share on other sites

This topic is 7315 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.