嗨我需要創建一個表單有兩個單選按鈕是和否提交按鈕,如果用戶不選擇任何選項警報應彈出說'請選擇一個選項',如果是的,並提交按鈕一個jQuery的對話框應該彈出與對話框中的兩個按鈕確定和取消 - >如果用戶點擊確定,然後它應該去不同的頁面,如果沒有單選按鈕,並提交按鈕,那麼對話框應該彈出相同的好和取消按鈕,如果確定,那麼它應該去另一個頁面。我創建了這樣的事情,但不能夠給選定的單選按鈕使用jquery dialogbox的兩個單選按鈕的形式
<form action="" method="get" name="radval">
<table width="100">
<tr>
<td width="41"><input name="xyz" type="radio" id="yes_chk" value="" required>
Yes</td>
<td width="47"><input name="xyz" type="radio" id="yes_chk" value="" required>
No</td>
</tr>
<tr>
<td colspan="4"><input type="submit" value="Submit" id="button"></td>
</tr>
</table></form>
的JavaScript
<script src="js/jquery.reveal.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#button').click(function(e) { // Button which will activate our modal
$('#modal').reveal({ // The item which will be opened with reveal
animation: 'fade', // fade, fadeAndPop, none
animationspeed: 600, // how fast animtions are
closeonbackgroundclick: true, // if you click background will modal close?
dismissmodalclass: 'close' // the class of a button or element that will close an open modal
});
return false;
});
});
</script>
如何根據所選擇的單選按鈕我重定向頁面。我是jquery的新手,有什麼幫助?
在此先感謝。
ü可以創建一個鏈接 – PSR 2013-03-04 08:32:38
不知道如何創建鏈接 – sailaja 2013-03-04 08:50:09