cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div id="wrapper">
  <div id="error"></div>
<form id="validation">

  
  <label for="email">Email</label>
  
  <input name="email" id="email" class="inputs"/>
 
  <label for="phone">Telephone</label>
  <input name="phone" id="phone" class="inputs"/>
  
  <label for="password">Password</label>
  <input type="password" name"password" id="password" class="inputs"/>
  
  <label for="password">Confirm Password</label>
  <input type="password" name"password" id="cpass" class="inputs"/>
  
  <input type="submit" value="Submit" id="btn" />
  </form>
</div>
            
          
!
            
              body{
  background:#232323;
}

#wrapper{
  width:600px;
  margin:0 auto;
  
  
}
#validation{
  background:#494949;
  border-radius:450px;
  padding:30px;
  border:1px solid yellow;
}
input{
  width:180px;
  padding:5px;
  border-radius:10px;
  border:1px solid;
  
  
}
label{
  width:200px;
  float:left;
  padding:5px;
  color:yellow;
  margin-left:15px;
  margin-right: -15px;

}

#btn{
  margin-left:40%;
  margin-top:20px;
  background:black;
  color:yellow;
  font-size: 16px;
} 

#error{
  color:red;
  font-size:22px;
  text-align:center;
}
            
          
!
            
              $("#validation").submit(function(event){
  var errorMessage="";
    event.preventDefault();

  
  // in the function for valid email address it created a function that checks to see if the email address is valid or not
  
  function isValidEmailAddress(emailAddress) {
    var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
    return pattern.test(emailAddress);

    
};

  if(!isValidEmailAddress($("#email").val())){
    
    errorMessage="This is not a valid email";
    
  
  }
  
  if(!$.isNumeric($("#phone").val())){
    
    errorMessage=errorMessage+"<br/>This is not a valid number";
 
  }
  
  if($("#password").val() != $("#cpass").val()){
    
       errorMessage=errorMessage+"<br/> This is not a valid password";
    
  }
  
  if (errorMessage==""){
   alert("success");
  } 
  
  else{
     $("#error").html(errorMessage);
  }
 });

$(".inputs").mouseenter(function(){
  var input={
    background:"yellow",
    color: "black"
    
  }
  $(this).css(input);
})
$(".inputs").mouseleave(function(){ 
  var styles= {
    background: "black",
     color: "white"
  }
  $(this).css(styles)
})
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console