Hi. I have a site with dynamic pages. On this site I have dropdown linked to a database. I like the placeholder to be equal to a text field (that is dynamically populated) of the site.
I have tried: $w(“#dropdown1”).placeholder = $w(“#text20”) ;
But this does not work, unfortunately I am not experienced enough to find the alternative. Can somebody help out?
Thanks for your feedback, tried your suggestion and it did not work. I got the following message:
Wix code SDK Warning: The placeholder parameter that is passed to the placeholder method cannot be set to null or undefined.
Thanks for your suggestion. Tried to add your suggested line, but still get same error:
Wix code SDK error: The placeholder parameter that is passed to the placeholder method cannot be set to the value [object Object]. It must be of type string.
Code now looks like:
$w.onReady(function () {
//TODO: write your page related code here…
$w(“#dataset1”).onReady(() => {
let text = $w(“#text20”);
$w(“#dropdown1”).placeholder = text;
});