正如标题所说 - 一个函数以某种方式阻止另一个函数,我得到了这个输入:
<input type="submit" name="submit" value="Submit" id="submit" onMouseOver="onSubmitHover()" onMouseOut="submitFadeOut()" />
当我删除onMouseOver函数时onMouseOut开始按需要工作。
以下是功能: 的onMouseOver:
function onSubmitHover()
{
var emailStatus = document.getElementById("emailstatus").innerHTML;
var passwordStatus = document.getElementById("passwordstatus").innerHTML;
var usernameStatus = document.getElementById("usernameStatus").innerHTML = "";
if((emailStatus == "This email is available")&&(passwordStatus != "Too short")&&(passwordStatus != "")&&(usernameStatus != "This username is available"))
{
document.getElementById("submitNote").innerHTML = "Submit data";
document.getElementById("submit").disabled = false;
}
else
{
document.getElementById("submitNote").innerHTML = "Please fill in required [*] fields";
document.getElementById("submit").disabled = true;
}
}
的onmouseout:
function submitFadeOut()
{
document.getElementById("submitNote").innerHTML = "";
}
问题:当我将鼠标移出按钮时,我希望“submitNote”为空,我的第一个函数以某种方式阻止它,我不确定如何,或者可能是一些深层次的错误,例如也许我我要求一次完成两项功能,这是我所不知道的。