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.

inserting a comma in the CDML field results

Featured Replies

Hi...I've created a simple database and used Claris Homepage to generate the Web interface to the db.

One field is used to collect the names of the users. In some of the pages of the Web interface, that info appears as a checklist in the db (so that people can click and unclick their names). In other pages, however, I want to display that same list of people as a list that's either separated with line breaks or with commas. How can I do this?

Here's the code that I'm working with: [FMP-field:Editor Designer Name]

With this format, all of the names are separated only by spaces. I'd like a break or a comma. I've tried adding <br> after the closing ], but that didn't work. (It works in the checkbox context, but not this one.)

Thank you for any help.

Barbara confused.gif

Try this:

[FMP-field:Editor], [FMP-field:Designer], [FMP-field:Name]

Good Luck.

Garry

  • Author

I'm so sorry that I wasn't clear about this...there is only one field in question and its name is "Editor Designer Name". That field contains entries like this: George W. Bush, Osama Bin Laden, Kim Jong-il.

Should I redesign the database to use a separate field for the first name and another field for the last name?

(Sorry if this is a really naive question! I haven't been using FM for very long if it isn't already painfully obvious :-)

Hi, if the field is a standard text field then FMPro should display it on the web just like it displays in the database.

If you want it to display:

Editor1, Designer1, Name1

Editor2, designer2, Name2

etc

then

[FMP-RECORD]

[FMP-FIELD: Editor Designer Name]<BR>

[/FMP-RECORD]

should work OK

but if you want:

Editor1

Designer1

Name1

Editor2

Designer2

Name2

then I guess you need to make a separate calculation field kinda like:

newfield= Substitute(Editor designer Name," ","P")

where "P" is that paragraph symbol (can't do it here!)

...and the cdml code would be the same, except you call the new field and use "break" to translate the line breaks:

[FMP-RECORD]

[FMP-FIELD:Newfield,Break]<BR>

[/FMP-RECORD]

Hope i understand what you want to do. If not, maybe post your cdml code here.

regards, jeff

PS: people generally tell me it can cause problems if you use spaces in fieldnames for the web.

  • Author

Thank you so much for the information. I'll try it now.

About spaces being potentially problematic for fields--I should have realized that. (Having used Unix for 25+ years, you would think I would have known better. :-)

  • Author

Actually, the field is a checkbox field (it isn't a text field). I should have included THAT information in my original post too. Would the calculation that you enclosed work for a checkbox field? (I have never looked into calculations before--looks like I should!)

The FM Layout Checkbox inserts the "P" hence, no need for the Calc field and this CDML (modified from Jeff's) will give you line breaks between each of the entries:

[FMP-Record]

[FMP-Field:Editor Designer Name,Break]<BR>

[/FMP-Record]

This is to give you a listing. You could use a little bit of Javascript to do other things.

All the best.

Garry

  • Author

Thanks to Garry and Jeff for helping. I couldn't quite get the calculation field to work (because I don't know enough about this), but the code that Garry sent worked.

Thank you both again, so much.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.