<html:form action="/login" onsubmit="return checkLogin();">
<input type="hidden" name="method" value="login"><html:submit value="登陆"/>function checkLogin(){
?
}<html:submit value="登陆"/> 按钮怎么变灰?
<input type="hidden" name="method" value="login"><html:submit value="登陆"/>function checkLogin(){
?
}<html:submit value="登陆"/> 按钮怎么变灰?
加入disable="true"
<html:submit value="登陆" disable="true" />
不好意思,应该是disabled="true" 少写了一个d
function checkLogin(){
documtent.getElementById('slogin').disabled=true;
if.....{
documtent.getElementById('slogin').disabled=false;
return false;
}
return true;
?
}
而且表单<html:form action="/login" onsubmit="return checkLogin();"> 也没id name属性
如果我想使表单中的提交按钮变灰 在function 里面应该怎么写?
虽然有些东西简单点
不要用html:submit,用button啊,不是一样嘛?
<input type="button" name="slogin" id="slogin" value="登陆" onclick="checkLogin()"/> function checkLogin(){
documtent.getElementById('slogin').disabled=true;
if(输入元素不正确){
documtent.getElementById('slogin').disabled=false;
return;
}
document.forms[0].submit();
}