Here’s a very basic example. I think this will solve your problem, but understand the logic.
Javascript is responsible for hiding the selected option and replicating in the other selects. That way you don’t have to send a post every time you select an option
$('.select').on('change', function() {
var option = $(this).val();
$('.select').each(function() {
$(this).find('option').show();
$(this).find('option[value=' + option + ']').hide();
});
});
<form action="#" method="POST">
<select class='select' name="select[1][]">
<option>Selecionar</option>
<option value='A'>A</option>
<option value='B'>B</option>
<option value='C'>C</option>
<option value='D'>D</option>
<option value='E'>E</option>
</select>
<select class='select' name="select[1][]">
<option>Selecionar</option>
<option value='A'>A</option>
<option value='B'>B</option>
<option value='C'>C</option>
<option value='D'>D</option>
<option value='E'>E</option>
</select>
<br>
<br>
<input type="submit">
</form>
In PHP =>
<?php
echo '<pre>';
print_r($_POST);
echo '</pre>';
exit;
/* Como o PHP vai capturar =>
[select] => Array
(
[1] => Array
(
[0] => A
[1] => B
)
)
*/
?>
NOTE: The result of this answer is also based on the comments of your question.
I’m waiting for feedback.
Before adding the Time consult in the bank if this team is already in the round.
– Krismorte
@Krismorte would do an if for example, to see if akele team this in the round,?
– user46438
Yes. Since you didn’t post your code, it is difficult to give other ideas. If you are working with List you can simply remove the team from the list and reload the Box. Anyway.
– Krismorte
I left the note at home and I’m at work at the moment but what I have on this screen 10 combobox Ex.: Time A X Time B. Where I insert a result for each match. And the combobox is generated from the BD.
– user46438
From what I understand there this screen with the 10 combobox need not exist. Since it will be informed the results and for that the round must have already been registered. Example Round A Time1 xTime2 time3 xtim4 Round B Time1 xTime3 time2 xtim4
– Krismorte
It would be something like happened today the round of Brasileirão, hence would for example register on the screen this round with the results. Ex.: Time A 2 x 1 Time C Time D 0 x 0 Time B. The excerpt from the work that talks about the result: To perform this work you can use the content seen in HTML, CSS, PHP, Database, Jquery, Javascript .
– user46438
Then go back to my first comment. Every time you register you have to make a query in the bank.
– Krismorte
I’m sorry to ask you this stupid question, but if I were to sign up, for example, team A as the lead team, for example, when choosing a visitor, wouldn’t Team A show up again? I would like to restrict this because surely my teacher will ask me for this validation. Thank you for your help and sorry to take your time.
– user46438
Load the sender’s combobox and add an event to it to load the other box from the selected item excluding it
– Krismorte
Thanks I’ll try.
– user46438