(I am French I use Google Translate to write to you)
Hello,
I would need you to help me.
When a user selects a value in a dropdown, I would like it to be added in my textbox a bit like adding mos keys one after the others except that my code deletes the text entered in the textbox and replaces it with a new one each time, I would like the value to appear after the text.
Here is the code I wrote so far :
export function dropdown1_blur(event) {
let value1 = $w("#dropdown1").value
$w('#textBox1').value = + value1
}
export function dropdown2_blur(event) {
let value2 = $w("#dropdown2").value
$w('#textBox1').text = + value2
}
Thank you in advance for your help.
Have a lovely day everybody.
Regards
Salut mon amie cava? Petit problems avec --> CODING? Pas de problem! 😉 Regarde bien!!!
What you want is surely to populate a Drop-Down with options, right?
// BASIC: ---> GENERATING an ARRAY.... let dropdownOptions = []; //First getting the already given Drop-Down-Options from your Dropdown into an ARRAY... dropdownOptions = $w("#myDropdown").options; //Second --> Pushing/Adding new options to the already given options in the ARRAY... dropdownOptions.push({"label": "New Label", "value": "New Value"}); //Last-step: Pushing the whole (new created ARRAY) to the DropDown-Options! $w("#myDropdown").options = dropdownOptions;
And now try to get everything to work. You will of course have to modify and optimize my given example code-snipets, to get your whole process working!
Beaucoup de chance!