1
function subVal() { if (document.forms['loginform'].name.value == '' || document.forms['loginform'].uid.value == '') { if (document.forms['loginform'].uid.value == '') { document.getElementById('afterpass').innerHTML = 'FORGOT PASSWORD'; } if (document.forms['loginform'].name.value == '') { document.getElementById('aftername').innerHTML = 'FORGOT USERNAME'; } } if (document.forms['loginform'].name.value != '' && document.forms['loginform'].uid.value != '') { document.forms['loginform'].submit(); } }
當我嘗試驗證時,它執行它應該執行的操作(插入HTML)然後刷新。我怎麼能阻止這個?JavaScript表單驗證刷新頁面
是什麼形式的`action`設置爲? – sdleihssirhc 2011-01-28 06:11:59