選択したチェックボックスの値がエコーされない理由を知っている人はいますか?
Javascript コード:
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.form.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
// wait for the DOM to be loaded
$(document).ready(function()
{
// bind 'vgsForm' and provide a simple callback function
$('#vgsForm').ajaxForm(function()
{
$('#Suggestion').load('process_answers.php');
});
});
HTMLフォーム
<div id="Questions">
<form id="vgsForm" action="process_answers.php" method="get" >
<div id="Q1">
<label><input type="radio" name="q1option" value="Less than 16" />Less than 16</label><br />
<label><input type="radio" name="q1option" value="16 or more" />16 or more</label>
</div>
process_answers.php
echo('$_GET: '.print_r($_GET, true));
//Get Question 1
if (isset($_GET['q1option']))
{
$q1option = $_GET['q1option'];
}
else
{
$q1option = NULL;
}
echo("Selected: ".$q1option);
これはエコーされます:
$_GET: 配列 ( ) 選択:
どんな助けでも大歓迎です
ダニエル
PSこれは、JavaScriptコードを取得した場所ですhttp://malsup.com/jquery/form/
機能させるために追加の JavaScript コードが必要ですか?