0
我正在爲我的iPad做一個web應用程序來幫助我的兒子和他的數學。客戶端的JavaScript表單驗證,用隨機腳本編寫的表單
每當您重新加載頁面,它都會給您一個新的測試。我缺少的是客戶端驗證。我之前使用過jQuery,但從來沒有用過任何東西。 這是創建問題隨機字符串的一小段代碼。
問題是我沒有辦法實時驗證答案。
<tbody><tr>
<td><li class="smallfield"><span class="name"><script language="JavaScript">
<!--
var r_text = new Array();
r_text[0] = "1 x 1 =";
r_text[1] = "1 x 2 =";
r_text[2] = "1 x 3 =";
r_text[3] = "1 x 4 =";
r_text[4] = "1 x 5 =";
r_text[5] = "1 x 6 =";
r_text[6] = "1 x 7 =";
r_text[7] = "1 x 8 =";
r_text[8] = "1 x 9 =";
r_text[9] = "1 x 10 =";
r_text[10] = "1 x 11 =";
r_text[11] = "1 x 12 =";;
var i = Math.floor(12*Math.random())
document.write(r_text[i]);
//-->
</script></span><input placeholder="=" type="num" />
</li></td>
<td><li class="smallfield"><span class="name"><script language="JavaScript">
<!--
var r_text = new Array();
r_text[0] = "1 x 1 =";
r_text[1] = "1 x 2 =";
r_text[2] = "1 x 3 =";
r_text[3] = "1 x 4 =";
r_text[4] = "1 x 5 =";
r_text[5] = "1 x 6 =";
r_text[6] = "1 x 7 =";
r_text[7] = "1 x 8 =";
r_text[8] = "1 x 9 =";
r_text[9] = "1 x 10 =";
r_text[10] = "1 x 11 =";
r_text[11] = "1 x 12 =";;
var i = Math.floor(12*Math.random())
document.write(r_text[i]);
//-->
</script></span><input placeholder="=" type="num" />
</li></td>