NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: rupertvz on March 30, 2022, 03:36:36 AM
-
Hi Guys,
I would like to set a CSS condition based on a Cookie value saved by NetTalk.
Has anyone done this, or have an example?
Thanks in advance!
-
Hi Rupert,
I'm not sure I understand what you have in mind here. Perhaps explain in more detail?
It's not even clear if you want to write Clarion code or JavaScript code to do this.
Cheers
Bruce
-
Hi Bruce,
I have style sheets in a CSS file for my site.
1. I want to be able to set a Cookie value via my NetTalk application.
2. The CSS should then be able to read the Cookie (set by my application) and based on that - apply the correct CSS formatting.
-
>> The CSS should then be able to read the Cookie
As far as I'm aware, the CSS language has no ability to read cookies. So you will need to adopt another approach. (Since you don't mention what the _actual_ problem is, I can't suggest which approach would be best.)
I recommend you explain what your actual problem is, rather than search for advice on your proposed solution.
Cheers
Bruce
-
What about to change the CSS served by the browser based on a conditon?
if condition then Custon.css else Custon2.css end
Is that possible?
Regards
-
What about to change the CSS served by the browser based on a conditon?
if condition then Custon.css else Custon2.css end
Is that possible?
Regards
Do you mean similar to what you can do by using the url http://127.0.0.1:88/?_theme_=morris
I'd guess you could do something in p_web.ChangeTheme in the web handler
IF get some value from cookie = blarg then p_web.SetSessionValue('_theme_','blargTheme') .
??
-
Hi Bruce,
I have a list of "Large Buttons" on my index page.
I would like to show the last button clicked in a different CSS style, say "blue" button.
Thus setting a cooking with the "value" of the last button clicked, then apply the CSS style for the particular button based on the cookie value.
As an alternative, I can probably create a duplicate of each button (with a different CSS style), and hide the second one for each button set initially. Only showing the "second" button of a set when that set was last clicked.
-
Hi
I would add this in the "Button CSS Class": choose(p_web.GetValue('myCookie')='xx',' class1',' class2')
/Niels
-
Thank you Niels,
This is what I was looking for,
Thus the CSS class is able to read the Cookies.
Regards
Rupert