Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Performing ExactSearch on 2 fields using -LOP AND

Featured Replies

I'm trying to perform a search via a CDML web page on 2 fields of a database (field_1 and field_2)

I want the search to require that both fields get entered exactly.

The web security is set so that each needs to be an 'ExactSearch'.

The HTML reads


 <P><INPUT TYPE="hidden" NAME="-op" VALUE=eq>

<INPUT TYPE=text NAME=field_1 VALUE="" SIZE=30>

<INPUT TYPE="hidden" NAME="-LOP" VALUE=AND>

<INPUT TYPE=text NAME=field_2 VALUE="" SIZE=30>

<INPUT TYPE="submit" NAME="-Find" VALUE="Search"></P>

  

If I only limit field_1 to ExactSearch in the web security, I can type field_1 exactly and press Search and it finds the record. However, as soon as I restrict field_2 to ExactSearch, the web browser returns the error:-

"Access Restriction: You do not have access privileges to perform the action :find"

Any ideas where I'm going wrong ?

Thanks.

Gary

  • Author

Ok, I'm answering my own questions now.

I've not solved the above problem, but I've partly got around it by creating a calculation field called "mix" (which concatenates field_1 & field_2 within filemaker).

I've then added a small javascript function (concat) to my search webpage that looks like this (imagine the form is called 'formname' )

 

<SCRIPT TYPE="text/javascript"><!--

	

	function conc (){

	document.formname.mix.value = document.formname.field_1.value + document.formname.field_2.value; 

	alert ("checking "+document.formname.mix.value);

	}

	

	//--></script>





 

I've removed the security on field_1 and field_2 and now just set 'mix' to ExactSearch

It seems to work when I enter 2 correct values, and when I enter a wildcard character, it tells me I can't do this ! Excellent !!!

But if I enter a value that is not in the database, I get the message

'The format file "welcome.htm" could not be found'

I'm puzzled now !

welcome.htm is the result web page, which does exist in the web folder and actually works when correct values are selected, but why is filemaker trying to present this as my error page, when my error page has been defined as 'error.htm' ?

Thanks for any help.

Is the "error" page being called with "-error" or "-err". This is one that got me some time ago!

A "workaround" maybe to add an [FMP-If] tag at the head of the "welcome.htm" page to capture any errors.

Good Luck.

Garry

  • Author

I'm actually using -Error (with a capital 'E'), which is a bit strange because all the others seem to be lowercase). I've added it with Claris Homepage because it has all the CDML tags as drag and drop. (so it must be right ?)

I will try -err just in case.

I've actually got over it because it seems the error only occurs when no records are found. so I've added a script that gets performed after a search (using -Script.Presort), that checks if the status(currentfoundcount)=0, if it is then it performs a search for 1 record I've added called "blank".

I've then added an 'if' to my welcome page (as you suggest), but I haven't quite figured that out yet.

Anyway thanks for your help, and have a good Christmas / New Year. wink.gif

Re: "I'm trying to perform a search via a CDML web page on 2 fields of a database (field_1 and field_2)

I want the search to require that both fields get entered exactly."

First, you do not want to do an "exact match", rather you need to perform the "field contents match" which is different. See the Sample Files forum for CDML -Op values and Symbols demo which discusses the use of the FMPro search symbols.

Using the information from that demo you will find that your code might look like:

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

<input type="text" name="field_1" value="" size="25">

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

<input type="text" name="field_2" value="" size="25">

Second, the -lop is unnecessary as you are using it since "and" is the default. More on this in Sample Files forum at CDML -LOP values. Also in the CDMLRdb.

But what do I know,

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.