Validation of select field
I have a problem with validation of select field.
Because field is automatic filled by jquery the validation script (in php) don't "see" that the field is marked/selected.
If I select the field by "click" - everything is ok. but in some cases the user don't have the possibility to select this field (if finish_day is less than 4). What is interesting, when I delete the line 3 - validator works ok, but I need this line in the code - it select and change the another field.
The code is below:
- if( parseInt($("#finish_day").val()) < 4 ) {
- $('#return_car').children('#return_car option[value=' + $('#get_car').val() + ']').attr('selected', true).siblings().attr('disabled', true);
- if ($('#return_car').val()) $('#return_car').change();
- }
- else {
- $('#get_car > option, #return_car > option').prop('disabled', false);
- }
I will be grateful for any help!