SweetAlert2 Get the value from previous step

113 Views Asked by At

I need your help because I can not retrieve the value and do a test and then prefill the following field. Basically if we select in the morning, the proposed time will be 7am otherwise we can still modify this time.

Thanks for your help

        progressSteps: ['1', '2', '3']
    })
        var test = 0;
        var steps = [
        {
            title: ' Choose user?',
            input: 'select',
            type: 'question',
            inputOptions: listeUser,
            confirmButtonText: 'Next →',
            showCancelButton: true,
        },
        {
            title: ' Morning, AM or Night ?',
            input: 'select',
            type: 'question',
            inputOptions: typequart,
            confirmButtonText: 'Next →',
            showCancelButton: true,
            **inputValidator: (value) => {if(value === "'Morning'"){test = 1;}**
        },
        {
            title: 'Hour',
            input: 'text',
            inputPlaceholder : 'HH-MM-SS',
            **inputValue: if(test=1){input here this value (07-00-00)}**
            type: 'info',
            confirmButtonText: 'Next →',
            showCancelButton: true,
        }]; 
0

There are 0 best solutions below