Hey There!
I don’t know much about Javascript so I hope someone can help me achieve this.
This is what I’m trying to achieve:
^
In the Database named ‘Studio’ there’s a Text field named ‘TextColor’.
On the first dynamic page named ‘/a/editor/studio1’ the client set the value of TextColor to’#000000. As you can see, the text ‘WavePhotos’ appear in black.
v
On the second dynamic page named ‘/a/editor/studio2’ the client set the value of TextColor to ’ #ed6300 . As you can see, the text ‘WavePhotos’ appear in orange.
v
Does anyone know how to achieve this with code. So the client can change the text color?
Thank You!!
PS: I want to use it for more elements like buttons and boxes.
Hello!
The style attribute of text elements supports the color property among other ones.
Check out our API reference, section ‘Inline styling’: https://www.wix.com/corvid/reference/$w.Text.html#text
This means that you can assign the value of your input to the style attribute and hence change the text color when your users input their value.
Check out posts on a similar matter:
https://www.wix.com/corvid/forum/community-discussion/change-text-color-on-mousein
https://www.wix.com/corvid/forum/community-discussion/change-the-text-color-on-click
You can also store your users’ submissions in a database:
https://support.wix.com/en/article/corvid-tutorial-creating-a-form-to-store-user-input-in-a-database-collection