U
U
Uzair Izha2015-10-22 18:01:48
JavaScript
Uzair Izha, 2015-10-22 18:01:48

How to determine the clicked radio using jquery?

and then you need to send it to a php variable

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2015-10-22
@Stalker_RED

Or maybe instead of inventing the wheel, use $('#myForm') .serialize() , and send data from the entire form?

A
Anton B, 2015-10-22
@bigton

<form method="post" id="color_send">
<label><input type="radio" name="color" value="1" /> красный</label>
<label><input type="radio" name="color" value="2" /> черный</label>
<input type="submit" name="send" value="Отправить" />
</form>

<script>
$(function () {
    $('#color_send').submit(function () {
        $.post('/send.php', $(this).serialize());
        return false;
    });
});
</script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question