Jump to content

Popup menu value list tricks.


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

Recommended Posts

Hi, I'd like to have a value list where the displayed value is different from the value passed to the database, like:

<SELECT NAME=stuff>

<OPTION VALUE=1>first item

<OPTION VALUE=2>second item

</SELECT>

...rather than

<SELECT NAME=stuff>

<OPTION VALUE=first item>first item

<OPTION VALUE=second item>second item

</SELECT>

is there a way to get this from Filemaker, rather than just write it into the page?

thanks, jeff

Link to comment
Share on other sites

You could do this by manipulating the data in the file rather than the web page.

Make a normal value list, use it to enter into a normal field via the submit. In the database use a calc based on the field to generate the "real" value.

Link to comment
Share on other sites

Hi, thanks Vaughan, Garry

I think that a calculation might be a possibility. I guess I could assemble all of the html for the popup in a Filemaker calculation and deliver that as a field, but it might be as much work as altering the pages now and then.

The reason for wanting to do this is that when I have 'hard coded' list in pages, I always forget to change them when the data changes, so I like them to look after themselves.

thanks, Jeff

Link to comment
Share on other sites

You could use a Calculated concatenation with a separator for the ValueList field ; e.g. "1:first item". Then with some Javascript place them on the desired locations, like this:

<select name="stuff">

<script>

[FMP-ValueList: Groups, List=GroupList]

val = "[FMP-ValueListItem]".split(":") ;

document.write("<option value='" + val[0] + " [FMP-ValueListChecked]>" + val[1] + "</option>") ;

[/FMP-ValueList]

</script>

</select>


I haven't tried this.

Good Luck.

Garry

Link to comment
Share on other sites

Hi, thanks Garry, I hadn't seen 'split' used before - i think I could use this as I then only have to keep the list up to date in one place, which is great.

I kinda knew you would ask me to excercise my miserably inadequate Javascript skills, though

wink.gif

regards, jeff

Link to comment
Share on other sites

Hi, thanks Garry, I hadn't seen 'split' used before - i think I could use this as I then only have to keep the list up to date in one place, which is great.

I kinda knew you would ask me to excercise my miserably inadequate Javascript skills, though.

regards, jeff

Link to comment
Share on other sites

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