Join the Webstudio community

Updated 9 months ago

Set the value of binding variables

At a glance

The community member has created a new variable mySelectValue to get the value of a webstudio select element, and wants to use it in another child of that. The comments suggest that the only way to set the value of a variable is to use a "Form" or "Link" to change search parameters, which can then be accessed using system.search.MY_PARAM. Another community member suggests placing the select element inside a form and submitting the form to the current page, which will update the search parameters and allow accessing the value from the select element. However, there is no direct way to change the value of a variable directly at the moment.

Useful resources
We can get the value of the binding variables but how can we set them? For example, I have created a new variable mySelectvalue to get the value of the webstudio select element. And want to use it in another child of that.
B
P
7 comments
For now the only way is to use "Form" or "Link" to change search params which will can be accessed with system.search.MY_PARAM.
I think you didn't get me. For example, I want to set the select value in text. I have created a variable mySelectValue in the Body. https://apps.webstudio.is/builder/6c9676a4-2a95-41ea-8f9e-0702150f7738?authToken=22b98335-4395-48fa-9887-aba7cfb3f31c&mode=preview
Attachments
image.png
image.png
I tried to bind this to the value field. But not working.
Attachment
image.png
I get you. The only way to get this value is to place select inside form and submit this form to current page. It will update search params and you will be able to access value from "select".
There is no way to change variable value directly at the moment
Add a reply
Sign up and join the conversation on Discord