I have the following code:
$("#solDate").change(function () {
if ($(this).val().trim() == '') {
$("#solvedBy").val('Pick an option');
}
else {
$("#solvedBy").val('Please, pick the issue solver');
}
});
$("#solvedBy").change(function () {
if ($(this).val() == 'Please, pick the issue solver') {
//if (document.getElementById("solvedBy").valueOf == 'Please, pick the issue solver') {
$("#saveBtn").attr('disabled', true);
$("#slvByValMsg").text('You have solution date and no solver');
}
else {
$("#saveBtn").attr('disabled', false);
$("#slvByValMsg").text('');;
}
});
solDate
is a date textbox, while solvedBy
is a dropdownmenu. Both of these scripts work perfectly, but when I try to trigger the second with the first, it breaks.
In short, the sequence is: when people choose a solution date, on the dropdown menu the text 'Please, pick the issue solver' appears. When this happens, button should get disabled and error msg should appear until the person picks a solver.
When I set the solvedBy to 'Please, pick the issue solver', the command works. When I set the date, the value of solvedBy changes, but the second script doesn't execute (I think it doesn't recognize it as a change). The commented line didn't help too.