Get cookie value and computed text

Hi,

I have an Editable Field and Computed Text in a web form. The Editable Field gets the value from a cookie when the onLoad event occurs. It works fine, everytime I change the value of the cookie, the Editable Field’s value also changes (at onLoad event).

Now I want to display different messages in the Computed Text as the Editable Field changes to different values.

It seems I cannot grab the Editable Field’s value, I guess because the Computed Text value is computed prior the onLoad event (when the Editable Field’s value is “”).

Can anyone help how to solve this problem?

Thank you in advance!

Etyien

Subject: get cookie value and computed text

Hi Etyien!

You’re right, you computed value doesn’t display anything because it’s computed on the server side, before the client (browser) catches the cookie.

I think the best solution is to keep working on the onload of the web form so next thing you do after loading the contents of your cookie in your editable field is modify the value of the computed text.

To do this you will need to change your form, you will need to surround your computed text by a div tag or something similar

COMPUTED TEXT

So with Javascript you should be able to write the content of this DIV

Kind Regards

Alberto

Subject: RE: get cookie value and computed text

The point here is that anything that Domino computes (computed fields, computed text) is done on the server, while the onload event fires in the browser long after the server has finished doing its stuff. Assuming that the cookie has been previously created, though, it will be available at the server. There are two ways to get the cookie value: use a computed-for-display field called HTTP_COOKIE that is computed to itself; or use @GetHTTPHeader(“Cookie”) in a formula. You can still use a

or to actively update the data in the browser.

Subject: RE: get cookie value and computed text

Hi Guys,

Thank you very much for your help!

Etyien

Subject: RE: get cookie value and computed text

Here’s how I do it…

set the cookie using:

@SetHTTPHeader(“Set-Cookie”; “url=”+path_info);

get the cookie using:

@Word(@RightBack(@GetHTTPHeader(“Cookie”);“url=”);“;”;1)

where url= is the cookie for my variable url