Jump to content

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

Recommended Posts

Posted

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

Posted

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>

Posted

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]

Posted

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

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