Sharky Posted June 9, 2002 Posted June 9, 2002 Is it possible to make the text that a user searched for bold or italic?
Garry Claridge Posted June 9, 2002 Posted June 9, 2002 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
Keith M. Davie Posted June 9, 2002 Posted June 9, 2002 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?
Sharky Posted June 9, 2002 Author Posted June 9, 2002 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>
Sharky Posted June 9, 2002 Author Posted June 9, 2002 I had some problems but I fixed it! 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]
Sharky Posted June 9, 2002 Author Posted June 9, 2002 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now