Answers for "html can there be two submit input i one form"

1

multiple submit buttons in one form

<form action="" method="POST">
    <!-- fields -->
    <button type="submit" name="action" value="save">Save</button>
    <button type="submit" name="action" value="preview">Preview</button>
    <button type="submit" name="action" value="advanced_edit">Advanced edit</button>
</form>
Posted by: Guest on January-13-2022
0

same form two submits

<input type="submit" formaction="example.php">
<button type="submit" formaction="mail.php"> Button</buttton>
Posted by: Guest on February-08-2021
0

multiple submit buttons in one form

public function store(Request $request)
{
    switch ($request->input('action')) {
        case 'save':
            // Save model
            break;

        case 'preview':
            // Preview model
            break;

        case 'advanced_edit':
            // Redirect to advanced edit
            break;
    }
}
Posted by: Guest on January-13-2022

Browse Popular Code Answers by Language