Вы имеете в виду
$("form").on("submit",function(e) {
var text = $("[name=yourmenu]:checked").prev().text();
if (!confirm(text)) e.preventDefault(); // cancel submit if not confirming
});
Более сложная версия:
$("form").on("submit", function(e) {
var text = $("[name=yourmenu]:checked").prev().text() || "Intet valg";
if (text=="Intet valg") { // nothing selected
e.preventDefault();
alert(text);
return;
}
if (!confirm(text)) e.preventDefault(); // cancel submit if not confirming
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form>
<label class="container">
<p>Vil du have Pizza?</p>
<input type="radio" name="yourmenu">
<span class="checkmark"></span>
</label>
<label class="container">
<p>Vil du have Pasta?</p>
<input type="radio" name="yourmenu">
<span class="checkmark"></span>
</label><br/>
<input type="submit" />
</form>