Pls Help To Improve My code

I Have 3 range Slider ( #slider2hatchbac’, #slider3’, ‘#slider1’, ) And One dropdown I want to display the slider according to the options in the dropdown if the first option of the dropdown is selected then display ‘#slider2hatchbac’ likewise how to do it.

This is my code when I use this Code It’s working But the Problem is When I Select an option It Works its display only one slider But after Submitting The default value of the remaining two sliders is also saving in the dataset/Collection I only want to save the data of the slider which I selected in the dropdown.pls, help me by code.
export function dropdown1_change ( event ) {

if ( parseFloat ( $w ( ‘#dropdown1’ ). value )== 1 ){
$w ( ‘#slider2hatchbac’ ). show ( ‘slideIn’ );
$w ( ‘#slider3’ ). hide ( ‘slideIn’ );
$w ( ‘#slider1’ ). hide ( ‘slideIn’ );
}
if ( parseFloat ( $w ( ‘#dropdown1’ ). value )== 2 ){
$w ( ‘#slider3’ ). show ( ‘slideIn’ );
$w ( ‘#slider2hatchbac’ ). hide ( ‘slideIn’ );
$w ( ‘#slider1’ ). hide ( ‘slideIn’ );
}
if ( parseFloat ( $w ( ‘#dropdown1’ ). value )== 3 ){
$w ( ‘#slider1’ ). show ( ‘slideIn’ );
$w ( ‘#slider2hatchbac’ ). hide ( ‘slideIn’ );
$w ( ‘#slider3’ ). hide ( ‘slideIn’ );
}}

Where is your SUBMISSION-CODE?
If you connected your submission-button, with dataset, than this probably will not work.

You will have to code it.

Another thing is, that you can use the → dropdown-index instead of the value…see here…
https://www.wix.com/velo/reference/$w/dropdown/selectedindex

And to safe data, you simply use …
https://www.wix.com/velo/reference/wix-dataset/dataset/setfieldvalue

And before setting a new FIELD-VALUE you use this one…
https://www.wix.com/velo/reference/wix-dataset/dataset/new
…to create a new blank item

ThankYou