JSFiddle - React, Tailwind, and code Playground
by Ilia Lesnykh
HTML
<form method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1" accept-charset="UTF-8">
<label>
<input type="radio" name="currency" value="rur" id="rur">RUR</label>
<label>
<input type="radio" name="currency" value="usd" id="usd">USD</label>
<label>
<input type="radio" name="currency" value="eur" id="eur">EUR</label>
<br/>
<label>
<input type="radio" name="type" value="call" id="call">Call</label>
<label>
<input type="radio" name="type" value="90" id="90">up 90</label>
<label>
<input type="radio" name="type" value="radio" id="91180">91-180</label>
<label>
<input type="radio" name="type" value="radio" id="1811">181-1</label>
<label>
<input type="radio" name="type" value="radio" id="13">1-3</label>
<label>
<input type="radio" name="type" value="radio" id="3up">3+</label>
<br/>
<input type="submit" name="submit" id="submit" value="Submit">
</form>
<div id="result"></div>
JavaScript
$(function () {
$('#form1').on('submit', function (event) {
event.preventDefault();
var $currency = $('input[name="currency"]');
var $type = $('input[name="type"]');
if ($currency.is(':checked') && $type.is(':checked')) {
$.get("/echo/html/", {
name: "John",
time: "2pm"
}).done(function (data) {
alert('request is done!');
//$("#result").html(data);
});
} else {
alert('Необходимо выбрать одну валюту и один тип депозита!');
}
});
});