Jump to content

Display Value List Problem - Can this be done?


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

Recommended Posts

I have searched through the threads for displaying value lists from FMP databases, and I cannot find my specific problem/solution.

I have a database into which a Value List for each person is built, using entry into a field.

Then I want the user to login, and be able to retrieve their custom values in a pop-up.

I was using an inline action, but the value list is based on related field values from a second database.

Here is what I am using, and I only get an empty pop-up:

<select name="CourseMath">

[FMP-InlineAction: -db=CSTReg.fp5, -lay=Web, -view]

[FMP-Valuelist: CourseMath, list=MathEligibleYr]

<option value="[FMP-ValuelistItem]">[FMP-ValuelistItem]</option>

[/FMP-Valuelist]

[/FMP-InlineAction]

</select>

The field is CourseMath (text field)

The Value List is MathEligibleYr (related to _EligibleCourses, show related items in field EligibleMath)

I changed the Value list to one that is hard-coded (not related), and it works. So I assume the problem is with a value list of related values. I tried making a relationship to itself, to show the values from a lookup field, but that did not work either - it is still related.

Is there any way I can show the user-specific value list on a web page using CDML? Or can I use some code from another language, just to handle this issue?

Any help would be appreciated!! Thx!

-dana

Link to comment
Share on other sites

As a follow-up to my previous question, I have also tried using a token - and think this may be my solution, but I cannot get the value list to display the values of the field set equal to token.1.

Here is what I have with my attempt to use tokens:

<INPUT TYPE="text" NAME="-token.1" VALUE="[FMP-Field: VLMathYear]">

--I used text as the input type above just so i could be sure the field was properly going to token.1; I will use hidden normally.

<select name="CourseMath">

<option value="[FMP-CurrentToken:1]">[FMP-CurrentToken:1]</option>

[FMP-valuelist: CourseMath]

<option value="[FMP-valuelistItem]">[FMP-valuelistItem]</option>

[/FMP-valuelist]

</select>

I just get a single check mark at the beginning of the value list. What am I doing wrong?

Link to comment
Share on other sites

Hi Garry:

I am trying to use an inline action, but I only get an empty pop-up. Here is what I tried:

<select name="CourseMath">

[FMP-InlineAction: -db=CSTReg.fp5, -lay=Web, -view]

[FMP-Valuelist: CourseMath, list=MathEligibleYr]

<option value="[FMP-ValuelistItem]">[FMP-ValuelistItem]</option>

[/FMP-Valuelist]

[/FMP-InlineAction]

</select>

My field is CourseMath and my value list is MathEligibleYr; my value list is what has related values. Can this work? If not, I could import the value lists into the current DB, and then use a token as a value list based on that field - would that work?

Any help with my code would be appreciated - thx!

Link to comment
Share on other sites

Oh - and I think maybe I was not clear, my value list is actually created from values populated into a field of a separate table. Is there a way to create a value list based on values in a field? I tried doing that using a token, but could not get that to work either!

Link to comment
Share on other sites

If the ValueList is created by values in a field in "CSTReg.fp5" then it should work fine.

I believe that you may need to use something like this

<select name="CourseMath">

[FMP-InlineAction: -db=_EligibleCourses.fp5, -lay=Web, -view]

[FMP-Valuelist: EligibleMath, list=MathEligibleYr]

<option value="[FMP-ValuelistItem]">[FMP-ValuelistItem]</option>

[/FMP-Valuelist]

[/FMP-InlineAction]

</select>

However, if the list depends on a value you may need to use the Token like this:

<select name="CourseMath">

[FMP-InlineAction: -db=_EligibleCourses.fp5, -lay=Web, CourseYear={CurrentToken}, -sortfield=EligibleMath, -max=all, -find]

[FMP-Record]

<option value="[FMP-Field:EligibleMath]">[FMP-Field:EligibleMath]</option>

[/FMP-Record]

[/FMP-InlineAction]

</select>

The only problem would be to summarise the values. You can use a little bit of Javascript for this.

All the best.

Garry

Link to comment
Share on other sites

Thanks for the suggestions, Garry! I am still trying...

Okay - so you confirmed that FMP cannot display related value lists, so I am no longer using a related value list.

Now, I have imported the field text that makes up the value list into a field in the current DB, CSTReg.fp5

I am trying to call the information in the field, to be used in a pop-up - is that possible?

my code:

<select name="CourseMath">

<option value="[FMP-Field: VLMathYear]">[FMP-Field: VLMathYear]</option>

[FMP-valuelist: CourseMath]

<option value="[FMP-valuelistItem]">[FMP-valuelistItem]</option>

[/FMP-valuelist]

</select>

CourseMath = field to receive the data

VLMathYear= field that has the items to populate the value list, unique for every record

The above gives me a pop-up, but all the items are on one line, for example, instead of:

Math 400: Precalculus

Math 410H: Precalculus and Differential Calculus AB Honors

Math 710: Statistics AP

as 3 choices, I get one run-on choice of:

Math 400: PrecalculusMath 410H: Precalculus and Differential Calculus AB HonorsMath 710: Statistics AP

!!

Is there any way to have the web recognize that there ar separate lines? Or is this just not the way to do it. I tried the Inline Action, but got a blank pop-up menu.

I think my problem is that the values for each record are different, based on the information in a specific field for that record.

My other very tedious option, is to create a super-long If-then statement where I hardcode the values for each ID (about 70 per pop-up!). That is my escape route, but I would love to get this going. I can give URL if you think it is solvable.

I spent all this time getting the pop-ups customized, based on user-entry, that I would hate for it to go to waste!

Link to comment
Share on other sites

To have a field populate a popup you could use this:

<select name="CourseMath">

[FMP-Record]

<option value="[FMP-Field: VLMathYear]">[FMP-Field: VLMathYear]</option>

[/FMP-Record]

</select>

OR, you can create a new ValueList in the main file and use the usual [FMP-ValueList] syntax.

Good Luck.

Garry

p.s. In my opinon the best method is to use an [FMP-InlineAction] to the related file. As described in my previous post.

Link to comment
Share on other sites

  • 1 month later...

I am new to CDML. I am creating a searchable database that also uses relational values lists. I am using FMP6. I read through this thread, but don't know how to use the InlineAction tags. This is what I want to do:

Valuelist 1: Species. (I can create this is in my main db as a values-options list.) Will contain values like "Dog", "Cat", etc.

Valuelist 2: Breed. Relates to Species. If Dog is selected as Species, then Breed should only list related breeds (ie. Cocker Spaniel, German Shepherd.) How do I set that up without a related valueslist??

My other valuelist options from fields work just fine (ie. State, Country)

One other question: On the search results page, how do I display the select criteria values from the search page?

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Yes, exactly. If "Dog" is selected in Species, then I want the Breed valueslist to display only related dog breeds; same for Cats or other species.

I am even willing to create a separate values list for "Dog Breeds", "Cat Breeds", etc (for each species type), but then how do I get the correct list to display based on the species field?

Any help is appreciated!

Thanks.

Link to comment
Share on other sites

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