Jump to content

Combining Tokens & Value Lists


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

Recommended Posts

Hi all...

I have a online database set up for my fellow teachers to enter student data into. With some reading and experimenting, after finally updating my Filemaker to version 6, I can now use multiple tokens!!! (pretty cool...)

I understand how to set & pass a token between pages, but would like to now combine it with a value list so that the token data appears in the field first, but the user can click on it and get the value list (from the .fp5 database) instead. I was previously using a just value list in the field and am trying to save time for the teacher to enter multiple records.

Is there a way to do this?

Thanks, in advance for reading this and your help!!!

Brendon

Link to comment
Share on other sites

Garry,

Thanks for the reply. I tried your suggestion, and with a little modification, I'm close.

<select name="teacher">

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

[FMP-ValueList:teacher, list=teacher]

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

[/FMP-ValueList]

</select>

I chose teacher for the name of the field & the name of the value list in my .fp5 database.

If I use what is listed above, I am able to save anything from the valuelist correctly, but I then am unable to set/pass my token.

If I change the cdml to:

<select name="-token">

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

[FMP-ValueList:teacher, list=teacher]

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

[/FMP-ValueList]

</select>

now, I'm able to set/pass the token and see it (as well as the valuelist items) when I go to enter anothe record, but I save no information to the field "teacher" on the .fp5 database. Interesting thing though, I have the field teacher set as a required, not empty field, but it saves the record with nothing in the teacher field anyway.

What am I missing?

thanks again for the help!!!

Brendon

So, I'm close, but still a step off

Link to comment
Share on other sites

You will need to use some Javascript.

In the HEAD tags:

<script>

function modform()

{

with (document.myform)

{

elements['-token'].value = teacher.options[teacher.selectedIndex].value;

submit();

};

};

</script>

In the BODY:

<form name="myform" onsubmit="modform(); return false;" ......

.....

<input type="hidden" name="-token" value="">

<select name="teacher">

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

[FMP-ValueList:teacher, list=teacher]

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

[/FMP-ValueList]

</select>

......

Hope this is of value.

Garry

Link to comment
Share on other sites

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