I am experiencing two difficulties in my code
How can I prevent submission when the input field is empty upon clicking the submit button?
For the select-1 and select-2 JavaScript, how can I assign custom names to their values? For example, if AS400 is selected for select-1 (with the value option-1), I want it to be named AS400. Similarly, when selecting AS400 New Account for select-2 (value option-1a with class option-1), I want it to be named AS400 New Account.
$(function() {
$('#select-2 option:not([default])').wrap('<span/>');
});
$('#select-1').change(function() {
$('#select-2 span > option').unwrap();
$('#select-2 option:not(.' + $('#select-1').val() + ', [default])').wrap('<span/>');
//console.log($('#select-2').val());
});
...
//Code snippet continues
...
</script>