-1
如何保存單選按鈕的值。一位朋友已經做到這一點,以獲得一個cookie。 現在我需要去下一步,但我不知道如何。如何保存單選按鈕值
功能saveForm(n表單){
var nFields = nForm.length;
for (i=0; i<nFields; i++)
{
var isType = nForm[i].type;
alert(isType);
if (isType == 'radio'){alert('Field '+ i+ ' is a radio button')}
if (isType == 'select-one'){alert('Field '+i + ' is a select list')}
}
}
<form onsubmit="return saveForm(this)">
<input type = "radio" name = "staande_houding_globaal" value="0">
0 </input>
<input type = "radio" name = "staande_houding_globaal" value="1">
1 </input>
<input type = "radio" name = "staande_houding_globaal" value="2">
2 </input>
<input type = "radio" name = "staande_houding_globaal" value="3">
3 </input>
<input type = "radio" name = "staande_houding_globaal" value="4">
4 </input>
<input type = "radio" name = "staande_houding_globaal" value="5">
5 </input>
<input type = "radio" name = "staande_houding_globaal" value="6">
6 </input>
<input type = "radio" name = "staande_houding_globaal" value="7">
7 </input>
<input type="button" value="Volgende" onClick="history.forward()","saveState()" class = "volgende" />
</form>
不是100%清楚什麼目標是 – charlietfl 2014-11-23 13:55:35