このスクリプトがあり、警告メッセージを送信します。私が望むのは、アラートメッセージをフォーム内の div に入れることだけです。スクリプトは次のとおりです。
<script type="text/javascript">
var registered=false
function ExamineRegistration()
{
var email =document.regform.email.value;
var emailcheck= email.indexOf("@")
var emailcheck2= email.indexOf(".")
var password = document.regform.pass.value;
var passcheck = password.charAt(0)
var message_out = "Errors: "
if(email=="" || password==""){
message_out = message_out+"All boxes should be filled in, "
}
if(emailcheck==-1 || emailcheck2==-1)
{
message_out = message_out+"email must contain @ and ., "
}
if(password!=password)
{
message_out=message_out+"password must match"
}
if(message_out == "Errors: ") {
message_out = "You have successfully been logged in!"
registered=true
}
alert(message_out);
}
--> This function helps the user first to register and than to enter the site.
function Checkreg() {
if (registered ==true) {
location.replace("http://www.google.com")
}
else alert("Please Login to proceed")
}
</script>
フォームがあります。上部のフォーム内に警告メッセージを表示したいだけです。ポップアップの代わりにフォーム内に警告メッセージを表示する方法がわかりません。