/** * 注意:このjavascriptは、Jspとしてコンパイルされます。 * web.xmlのservlet-mapping参照 * @author asuzuki */ function submitButton(submitForm){ if (document.minilotoPastResultForm.searchway[1].checked){ var data = document.minilotoPastResultForm.kaigou.value; var checkOK = "0123456789"; var allValid = true; var allNum = ""; //必須チェック if (data == ""){ alert('回号を入力してください。'); document.minilotoPastResultForm.kaigou.focus(); return (false); } for (i = 0; i < data.length; i++){ ch = data.charAt(i); for (j = 0; j < checkOK.length; j++){ if (ch == checkOK.charAt(j)) break; } if (j == checkOK.length){ allValid = false; break; } allNum += ch; } //数字チェック if (!allValid){ alert('回号には数字を入力してください。'); document.minilotoPastResultForm.kaigou.focus(); return (false); } } var searchway = ""; if (document.minilotoPastResultForm.searchway[0].checked) { searchway = document.minilotoPastResultForm.searchway[0].value; } else { searchway = document.minilotoPastResultForm.searchway[1].value; } jp.co.takarakujinet.AjaxUtil.updateElementFrom( "result", "/ajax/miniloto/pastResultPage.do", { "searchway" : searchway, "year" : document.minilotoPastResultForm.year.value, "month" : document.minilotoPastResultForm.month.value, "day" : document.minilotoPastResultForm.day.value, "kaigou" : document.minilotoPastResultForm.kaigou.value, "howmany" : document.minilotoPastResultForm.howmany.value }, "POST"); } document.onkeypress = nextForm; function nextForm(evt){ if(document.all) { keycode = event.keyCode; } else { keycode = evt.keyCode; } if (keycode == 13) { submitButton(); return false; } return true; }