Jump 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.

found text bold or italic?

Featured Replies

Is it possible to make the text that a user searched for bold or italic?

You could use some Javascript for this. Look at the cdml tag [FMP-FindValueItem] and the Javascript function str.replace(). For example:

<script>[FMP-CurrentFind]

myString = "[FMP-Field:myField]".replace(/[FMP-FindValueItem]/gi,"<b>[FMP-FindValueItem]</b>");

[/FMP-CurrentFind]</script>

Hope this is of use.

Garry

Did you try <i>[fmp-field: fieldname]</i> and <b>[fmp-field: fieldname]</b>? What about <b><i>[fmp-field: fieldname]</i></b>, did you try?

  • Author

that is just a field and does not change based on the search from a user

I will try the javascript.

the result should be like:

user searched: test

text in the results: this is just a <b>test</b> en nothing els than a <b>test</b>

  • Author

I had some problems but I fixed it! smile.gif

this is how it is working now:

[FMP-If: CurrentAction.eq.FindAll]<a href="FMPro?-db=[FMP-CurrentDatabase]&-format=record_detail.html&-lay=[FMP-CurrentLayout]&[FMP-CurrentSort]-sortfield=[FMP-SortFieldItem]&-sortorder=[FMP-SortOrderItem]&[/FMP-CurrentSort][FMP-CurrentFind]-op=[FMP-FindOpItem]&[FMP-FindFieldItem]=[FMP-FindValueItem]&[/FMP-CurrentFind]-lop=[FMP-CurrentLOP]&-max=1&-skip=[FMP-FIELD: recordnrminusone]&-[FMP-CurrentAction]"> [FMP-Field: title]</a>[FMP-Else]<a href="FMPro?-db=[FMP-CurrentDatabase]&-format=record_detail.html&-lay=[FMP-CurrentLayout]&[FMP-CurrentSort]-sortfield=[FMP-SortFieldItem]&-sortorder=[FMP-SortOrderItem]&[/FMP-CurrentSort][FMP-CurrentFind]-op=[FMP-FindOpItem]&[FMP-FindFieldItem]=[FMP-FindValueItem]&[/FMP-CurrentFind]-lop=[FMP-CurrentLOP]&-max=1&-skip=[FMP-FIELD: recordnrminusone]&-[FMP-CurrentAction]"><script language="JavaScript" type="text/javascript">

myString = "[FMP-Field: title]".replace(/[FMP-CurrentFind][FMP-FindValueItem][/FMP-CurrentFind]/gi,"<b>[FMP-CurrentFind][FMP-FindValueItem][/FMP-CurrentFind]</b>");

document.write(myString);

</script></a>[/FMP-If]

  • Author

I put it like this in http://www.ib2.nl/filemaker/:

[FMP-If: CurrentAction.eq.FindAll]

[FMP-Field: title]

[FMP-Else]

<script language="JavaScript" type="text/javascript">

myString = "[FMP-Field: title]".replace(/[FMP-CurrentFind][FMP-FindValueItem][/FMP-CurrentFind]/gi,"<b>[FMP-CurrentFind][FMP-FindValueItem][/FMP-CurrentFind]</b>");

document.write(myString);

</script>

[/FMP-If]

somewhat easier to read smile.gif

Create an account or sign in to comment

Important Information

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

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.