フォームには2つのボタンがあり、どちらが選択されているかはデータベースから削除または編集されます。それらはそれぞれSQL文(questioneditとquestiondelete)を使用した個々のページです。しかし、私はボタンを押すと、何も起こりません...任意のアイデアPHPフォーム複数のボタン
をここに私のjavascript
function SelectedButton(button)
{
if(button == 'edit')
{
document.testedit_questionform.action ="testedit_questionedit.php";
}else if(button == 'delete'){
document.testedit_questionform.action ="testedit_questiondelete.php";
}
document.forms[].testedit_questionform.submit();
}
は、ここに私のフォーム(ループからエコーさ)
<form name="testedit_questionform" action="SelectedButton" method="POST">
<span class="grid_11 prefix_1" id="" >
Question:<input type="text" name="QuestionText" style="width:588px; margin-left:10px;" value="$row[0]"/>
<input type="button" value="Edit" name="Operation" onclick="submitForm('edit')" />
<input type="button" value="Delete" name="Operation" onclick="submitForm('delete')" />
<input type="hidden" name="QId" value="$row[3]" /><br />
</form>
私が必要なもの、ありがとう! – Ken