At first glance, the title already shows the error, but this is the process I need but I have no idea how to do it.
Given a simple form for example:
<form method="post" action="trata_form.php">
<input type="text" placeholder="Insira sua cor"/>
<button type="submit">Add</button></br></br>
<input type="checkbox" value="vermelho"/>Vermelho</br>
<input type="checkbox" value="vermelho"/>Azul</br>
<input type="checkbox" value="vermelho"/>Branco</br>
<input type="submit" value="Envia Form"/>
</form>
The idea is that when the user clicks the button after inserting a new color, this action will insert the new color into the color table and through an ajax the form will be updated with a checkbox containing the new color. Until then, okay.
The question is whether this action (click on the button to add new color) should occur through an "action"? if this is how I should proceed, because the form's action is already present, however it should only "act" after the new color has been inserted and presented.
You do not need ready code, just a way for me to figure out how to solve this process.
Now, tks!