여러 텍스트 상자가있는 HTML 양식을 만들었습니다. 내가하고 싶은 일은 텍스트가없는 상자 옆에 작은 이미지를 표시하는 javascript 스크립트를 만드는 것입니다.html 폼 유효성 검사를 사용하여 이미지를 표시하는 방법
을 내가 원하는만큼 양식의 유효성을 검사하는 다음 스크립트를 생성 한 순간 '내가 돈 때문에 그러나 그것은 단지 팝업 상자가 표시됩니다 : 여기에 내가 뭘 원하는지의 예입니다 이미지/텍스트를 표시하는 방법을 알고 있습니다. 다음은 내가 가지고있는 코드입니다.
<script type="text/javascript">
function validateForm()
{
var x=document.forms["email_form"]["name"].value;
if (x==null || x=="")
{
alert("Please enter your name in the box provided.");
return false;
}
var x=document.forms["email_form"]["email"].value;
if (x==null || x=="")
{
alert("Please enter your e-mail address in the box provided.");
return false;
}
var x=document.forms["message-title"]["name"].value;
if (x==null || x=="")
{
alert("Please enter a message title in the box provided.");
return false;
}
var x=document.forms["email_form"]["message"].value;
if (x==null || x=="")
{
alert("Please enter your message in the box provided.");
return false;
}
}
</script>
누군가 올바른 방향으로 나를 가리킬 수 있습니까?