Form Stack - visitor consent font colour

Hi,

is it possible to change the colour of the visitor consent line?

thx,
M

Just add a color tag in front of the text:
<font color="#B70017">

image

@Fuellemann — You seem to have forgotten the closing tag in your example.

1 Like

thanks for your quick reply, this is really good to know!

hi just tested it and unfortunately it does not work, the page gets completely empty as soon as i put in a font color tag:

<font color="#FF0000"> Ich stimme der Datenverarbeitung laut den Bedingungen unserer Datenschutzordnung zu </font>

webpage:
http://www.mkuehbandner.de/vllv/Kontaktformular/Kontakt/

is it because it has to be a php because of the form?

thx
M

It doesn’t like the color tag. You’re better off using an actual style attribute anyway.

Try this:

<font style="color:#FF0000;">Ich stimme der Datenverarbeitung laut den Bedingungen unserer Datenschutzordnung zu</font>

thank you, but his does unfortunanetly not work either…

http://www.mkuehbandner.de/vllv/Kontakt/Kontakt/

Does it work in preview? I tested it in a sample project and it works fine for me. I did not publish my test.

You’re embedding quotation marks into a field that really wasn’t designed around taking them. You’re interrupting the existing PHP quotes with your own custom code.

You can try switching to single quotes instead of doubles quotes, or add a backslash \ before each of the double quotes in your custom code.

Let use know how that works.

Inserting custom code sometimes comes with pitfalls and challenges.

yes it works ok in preview

<font style=\"color:#FF0000;\">Ich stimme der Datenverarbeitung laut den Bedingungen unserer Datenschutzordnung zu</font>

<font style=color:#FF0000;>Ich stimme der Datenverarbeitung laut den Bedingungen unserer Datenschutzordnung zu</font>

like that it does not work because the whole tag is not working anymore
:frowning:

Using Singles Quotes, as per my first suggestion seems to work fine:

<font style='color:#FF0000;'>Ich stimme der Datenverarbeitung laut den Bedingungen unserer Datenschutzordnung zu</font>

CleanShot 2020-08-13 at 13.11.41

Temporary link to form page: https://elixirgraphics.com/test/form-consent-msg/

I’d have to dig deeper to see why escaping the double quotes isn’t working. But there’s not really a need to, since single quotes works A-OK.


Addendum: The reason it doesn’t work in this case escaping the quotes with a backslash is that the string variable used for the content in that field in the settings is used both in some PHP and in some HTML. It escapes the PHP fine, but that leads to a problem with the HTML. So this custom code just needs to use single quotes for any properties you’re applying to the text in the field. This corner case could be worked around by passing the custom localization text from the stacks control to the form via a PHP string variable instead of injecting it as a stacks variable in both the PHP and the HTML form within the stack.

TL;DR – the field wasn’t designed to handle what you’re doing with it, so this caused some problems when escaping the double quotes. Use single quotes instead.

1 Like

Good to know, thank you! …

Thanks Adam, that works!

Excellent Support as always, thank you again and have a good one!
Michael

1 Like