JSFiddle - React, Tailwind, and code Playground
HTML
<form method="POST">
<select name="proizvod[]">
<option value="1">nesto</option>
<option value="2">nesto1</option>
<option value="3">nesto2</option>
</select>
<select name="proizvod[]">
<option value="1">nesto</option>
<option value="2">nesto1</option>
<option value="3">nesto2</option>
</select>
<button type="submit">Submit</button>
</form>
JavaScript
jQuery(document).ready(function () {
jQuery('button[type="submit"]').click(function () {
jQuery('option:selected').each(function () {
if (jQuery('option:selected[value="' + jQuery(this).attr('value') + '"]').length > 1) {
alert('Error!');
return false;
}
});
});
});