jeudi 31 mars 2016

Hidden input field value should be changed according to the drop box selection

This my script code. There's something wrong with it.

$(function() {
    $('#type').on('change', function() {
        if ($('#type').val('Workshop'))
            $('#color').val($('Orange').val());
        else if ($('#type').val('Social'))
            $('#color').val($('Green').val());
        else if ($('#type').val('Other'))
            $('#color').val($('Red').val());

    });
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire