Jump to content

inserting a comma in the CDML field results

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

Recommended Posts

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

Link to comment
Share on other sites

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 :-)

Link to comment
Share on other sites

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




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


should work OK

but if you want:







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:




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.

Link to comment
Share on other sites

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. :-)

Link to comment
Share on other sites

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!)

Link to comment
Share on other sites

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-Field:Editor Designer Name,Break]<BR>


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

All the best.


Link to comment
Share on other sites

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