0

hello, can u plz help me?? I can't run the javascript on Mozilla nad IE(can run on Chrome) I don't know why. I think my javascript has some problem. Here is my code .....

<script>
		function check()
		{
		if(document.getElementById("name").value==""||document.getElementById("address").value==""||document.getElementById("phone").value==""||document.getElementById("email").value==""||document.getElementById("username").value==""||document.getElementById("passwd").value==""||document.getElementById("passwd2").value==""){
		alert("You need to complete the form");
		}
		else continue;
		}
		
		function check_no()
		{
		var no=document.getElementById("phone").value;
		
		if(isNaN(no)==false){alert("right");}
		else {alert("Only number");}
		}
		
		function check_email(email,alerttxt)
			{
			with (email)
			  {
			  apos=value.indexOf("@");
			  dotpos=value.lastIndexOf(".com");
			  dotpos2=value.lastIndexOf(".net");
			  if (apos>1)
				{
				  if(dotpos-apos>1||dotpos2-apos>1){document.getElementById('email_error').style.visibility="hidden"; return true;}
				  else{document.getElementById('email_error').style.visibility="visible";}
				  }
			  else {document.getElementById('email_error').style.visibility="visible";}
			  }
			}
			
			function check_pass()
			{
			var first=document.getElementById("passwd").value;
			var second=document.getElementById("passwd2").value;
			if(first==second)continue;
			else {alert("Passwords do not match");document.getElementById("passwd").value="";document.getElementById("passwd2").value="";document.getElementById("passwd").select();}
			}
	</script>

Thz u for ur helps.

5
Contributors
11
Replies
12
Views
7 Years
Discussion Span
Last Post by diafol
0
function check()
		{
		if(document.getElementById("name").value==""
			||document.getElementById("address").value==""
			||document.getElementById("phone").value==""
			||document.getElementById("email").value==""
			||document.getElementById("username").value==""
			||document.getElementById("passwd").value==""
			||document.getElementById("passwd2").value==""){
			alert("You need to complete the form");
		}
		}

Remove elsepart with continue;

function check_pass()
			{
			var first=document.getElementById("passwd").value;
			var second=document.getElementById("passwd2").value;
			[B]if(!(first==second)){alert("Passwords do not match");document.getElementById("passwd").value="";document.getElementById("passwd2").value="";document.getElementById("passwd").select();} [/B]
			}

Make the changes in the function like above here to removed the continue.

Edited by rajarajan07: n/a

0

Did you think of posting this in the JS forum?

0

Actually I used it in HTML file ... to check validation...

0

Actually I used it in HTML file ... to check validation...

Of course, but it's still a js issue. You may get more js experts in the js forum.

-1

Thanks for sharing knowledge.

Votes + Comments
You should die a horrible death for sig spamming
0

Thai spy with my little eye a spammer beginning with servertoday. Shameless. Go clog up another site.

0

>hi, i need help concerning js is there anybody that can help?

Go - to - the - JS - forum...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.