How to make a button(input) work for only one textbox in html?

390 Views Asked by At

In the code below all submit and reset buttons works for all textboxes, however I want it to make it so that every button applies to the textbox one above it. I want one button to work for only one textbox.

<form name="email" action="mail.php" method="get">
        <table>
            <tbody>

                <tr><td>Ad:</td><td><input type="text" name="ad" size="20" maxlength="30" required></td></tr>
                <tr><td>Soyad:</td><td><input type="text" name="soyad" size="20" maxlength="30" required></td></tr>
                <tr><td> <td></td> </td></tr>
                <tr><td> <td></td> </td></tr>
                <tr><td> <td></td> </td></tr>
                <tr><td>email:</td><td><input type="email" name="email"></td></tr>
                <tr><td><input type="submit"></td><td><input type="reset"></td></tr>
                <tr><td> <td></td> </td></tr>
                <tr><td> <td></td> </td></tr>
                <tr><td> <td></td> </td></tr>
                <tr><td>Web:</td><td><input type="url"></td></tr>
                <tr><td><input type="submit"></td><td><input type="reset"></td></tr>

            </tbody>
        </table>
    </form>

How can I do that?

1

There are 1 best solutions below

3
Nihar Ranjan Das On

For this I think you need submit the request through javascript Then you can able to controll the form and able to send exact data to server