Jump to content

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

Recommended Posts

Posted

I have a few records displayed (all on one page) and I am trying to set a cookie based on whatever record the user clicks on. But the cookie is always getting set to a value from the last record displayed, not the one they click on.

The idea is the user clicks the link in a record and it then goes to a page to create a new record in another database, where MyField is pre-filled in. This bit works fine it's just the wrong value pre-filled.

The key part of code in my format file is...

[FMP-record]

<P>

Value of MyField:[FMP-field: MyField].<BR>

<A HREF="FMPro?-db=MyDatabase&-lay=Detail%20Layout&-format=CreateEntry.html[FMP-SetCookie: MyFieldCookie=field:MyField]&-new">Create another record with the same MyField</A>

</P>

[/FMP-record]

I'm using FMP4 Mac, and was avoiding a token because I'm using that for something else. I did try setting the field value within the URL, but this creates a new record before the user has the chance to entered other data!

Thank you if you can help.

Posted

Just for info on this...

It doesn't work because the Cookie appears to get set regardless of whether the user clicks on the url or not.

In testing I also found setting/reading/setting/reading aCookie on the same page gave unpredictable results.

In the end I used -token and managed to get a cookie working where I originally used the token.

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