Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script>
  function ValidateIPaddress(inputText)  
  {  
    var ipformat = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/; 
     ipformat = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/; 
   if(inputText.value.match(ipformat))  
 {  
 alert("You have entered valid IP address!.");
   return true;
 }  
 else  
 {  
 alert("You have entered an invalid IP address!");  
           
 }  
  }  
</script> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple IP Address Validation</title>
</head>
  <form name="form1">
<h2>Example IP Check</h2>
  <input type='text' name='text1'/>
  <input type="submit" name="submit" value="Submit" onclick="ValidateIPaddress(document.form1.text1)"/>
  </form>
<body>
</body> 
</html>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers