, 나는 시간이 입력 텍스트 상자에 입력 된 값이 있으며 길이가 6 자 이상임을 의미합니다.InputText]를 빈 체크
어떻게해야합니까? 내가 시도
코드 :이와
<script type="text/javascript">
function required(){
if (document.getElementById("Username").value.length == 0)
{
alert("message");
return false;
}
return true;
}
</script>
:
<h:body>
<h:form onsubmit="return required();">
Please enter your username:
<h:inputText id="Username" value="#{user.id}">
</h:inputText><br></br><br></br>
To print a piece of text, please press the submit button below to upload the text:<br/><br/>
<h:commandButton type="submit" value="Submit" action="upload/uploadText"/>
</h:form>
</h:body>
나는 여전히 얻을 수 없습니다입니다 스크립트 당신은에 <=
에 =<
을 변경해야
첫 번째 단계 : 자바 스크립트 유효성 검사에 대해 읽어 적이 있습니까? [무엇을 시도 했습니까?] (http://whathaveyoutried.com)? – epascarello
나는 js 유효성 검사에 대해 읽었는데, 난 그냥 그 inputtext 상자를 확인하는 방법을 모르겠다, 코드 위의 게시물 코드를 시도했습니다 – user1924104
그것은 약간 낫다. '필수 '라고 어떻게 부릅니까? – epascarello