Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Using custom web publishing. Have a web page that I can enter a find criteria and then hit the submit button. This then goes to a new web page that displays all the records that match the find criteria. All works well, except for one odd item.

The find works for exact matches, which is what I want it to do. So if I do a search for "Cars" it only shows records for "Cars" but not records for "Car." To find records with "Car" I have to do a search for just "Car." This is correct and working the way I want. But here is what IS NOT working correct. If I do a find and leave the criteria blank, and hit the submit button, it returns a search result and shows ALL records available.

Is there a way to have it not do that. In other words, if the find criteria is left empty I want it to find nothing. Here is a sample of my CDML tags.

<input type="hidden" name="Web" value="==" border="0"><input type="hidden" name="-lay" value="Results"><input type="hidden" name="-db" value="@hand.FP5"><input type="hidden" name="-sortfield" value="Project"><input type="hidden" name="-error" value="errors.htm"><font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><span class="text"><input class="text" type="text" name="Web" value="" size=8> <input type="hidden" name="-find" value="Submit"><input type="hidden" name="-format" value="Summary.htm"><input type="hidden" name="-max" value="All">

LR

Posted

When you have submitted the -find request with a blank field and gotten all records, did you then go to the db and perform a "Modify Last Find"? Doing that will show you what is being entered into "Web" and may help direct you to an answer.

Your error page is what should be generated.

An option is to use JavaScript to deliver a message if the field is left empty.

Posted

And then the thought occurred to me, (So if I do a search for "Cars" it only shows records for "Cars" but not records for "Car."), what happens with a search on "c"?

My standard response to the exact find:

Remember that you are trying to get your format file to talk with your db file.

USE THIS RESOURCE OFTEN.

http://www.filemaker.com/support/index.html

________________________________________________________

Search and read: Article Number: 104829, and Article Number: 105687

________________________________________________________

Understanding the use of the symbols of an exact search in a cdml solution will enable you to understand how to use in your cdml solutions all the symbols available in the FMPro db find operation (see db status bar).

See also these useful threads in the cdml forum for examples and other approaches/ideas:

Posted

When I do a find using "C" I dont get any results (redirected to my error page). It has to be an EXACT search criteria such as "Cars."

That is why I was so suprised that doing a find with leaving the find field empty yielded results. From what I have read and from how I set up my html tags it should not do this. That is why I am posting a question here...

LR

Posted

The above suggestion to perform the find via the web, then go to the actual db and do a modify last find was a GREAT suggestion. This helped me figure out what is happening. It relates to my CDML tag <input type="hidden" name="Web" value="=="

When I do a find from the web page and leave the criteria empty, what is happening on the db side is that a == is being placed in the field. And of course any records with the field in question is blank, well all those records are found.

Is there a different way in my CDML tag of using value="==" so that only exact matches are found but that if the find criteria is left blank it wont find all the records with a blank field?

LR

Posted

Instead of:

<input type="hidden" name="Web" value="==">

try:

<input type="hidden" name="-op" value="eq">

That one did it. So I assume the using "eq" instead of "==" results in an exact match, and that it also does not consider blank fields as being an exact match.

Anyway, thanks.

LR

Posted

When in either Find or Modify Last Find in the db, look in the status bar and click Symbols. There among other symbols you will find that "=" is for an exact find (same as .eq.) and "==" is for field content match.

<font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><span class="text">

<input type="hidden" name="-db" value="@hand.FP5">

<input type="hidden" name="-lay" value="Results">

<input type="hidden" name="-format" value="Summary.htm">

<input type="hidden" name="-error" value="errors.htm">

<input type="hidden" name="-sortfield" value="Project">

<input type="hidden" name="-max" value="All">

<input type="hidden" name="Web" value="=">

<input class="text" type="text" name="Web" value="" size=8>

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

Posted

The find in which just "==" was entered functioned properly in finding all those records which presented a "field contents match" for a blank field. Your experience demonstrates the need to understand the meanings of the various symbols.

Posted

Needed to revive this thread. Came up with another variation on this.

Using <input type="hidden" name="-op" value="eq"> in my CDML tags.

Now when doing a search I am only getting exact matches. If I leave the field blank

then no matches.

This all works great. But my goal is to have the search be secure. That is why I dont

want anyone to be able to find anything EXCEPT exact results. I found one instance

still where the search results are not secure. As stated above there are many ways

to do a find. for example: <0 or how about ... and >1

None of these work in my CDML <input type="hidden" name="-op" value="eq">

This is a good thing...I dont want them to work. But one that still does work is =

By using = basically all my records which contain the field that is blank are displayed.

I as of yet have not been able to find a way to negate this. Any other thoughts?

LR

Posted

Using the .eq tag and then entering "=" as a search criteria has the same effect as entering "==", the symbol for a field content match which in this instance will find all blank records.

Instead of worrying about it at this end, you might consider on your results page:

[fmp-if: fieldname .neq. ""]

display these records

[fmp-else]

display a "No records found" message

and a button to "try again"

(or whatever order gives you the results you want).

Posted

Keith,

Thanks for your comments. It helped provide me with a simple solution. Of course if it was simple, I would have thought of it myself.

Instead of worrying about how my find was working on the web, I just added a calc. field to filemaker. The calculation was an if that looked at the other field, if its contents were >0, the calc field then uses those contents. If the field it was looking at was empty, then my calc field would contain some garbage infor such as kf8&$%(kd.

Now on the web page (CDML) I have it directed at the calc field for the find instead of the original. Now users cant do a find and come up with any records that the original field was blank. Pointing to the calc field solved this.

Thanks.

LR

Posted

I know from my own experience that it is very easy to get caught-up in trying to do something THIS WAY. And we beat ourselves up trying to do it THIS WAY. And for whatever reason THIS WAY does not work this time. When what we need to do is step back for a moment and remember that with FileMaker there are usually different ways to design a solution. And sometimes it takes a gentle reminder from someone that there are those different design choices. I'm glad that my suggestion helped in that way.

(Think Different, now where have I seen that???)

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