npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ang-validator

v0.1.2

Published

The jQuery form validation plugin makes easier to apply validations on html form field. It has many options for different types of validations like url, email, numeric type, file validation etc.

Downloads

4

Readme

ANG Validator - jQuery form validation plugin

The jQuery form validation plugin makes easier to apply validations on html form field. It has many options for different types of validations like url, email, numeric type, file validation etc.

It provides easy way to apply custom validation options like inline css.

Getting Started

Include required files in head tag :

<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> 
<script type="text/javascript" src="angvalidate-1.0.min.js" ></script> 
<link rel="Stylesheet" type="text/css" href="angvalidate.css" />

Initiate plugin using following code :

<script type="text/javascript"> 
$(document).ready(function(){ 

$('.required').angvalidate(); 

}); 
</script>

You can initialise plugin to override default settings :

$('.required').angvalidate({ 

error_message :'This field is required.', //default error message 

error_message_ext :'File type is not valid.', //default file type error message 

error_message_size :'File size is not accepted.', //default file size error message 

error_msg_class :'error_msg', //default error message class 

error_input_class :'error_input', //default error input class 

success_input_class :'success_input', //default success input class 

allowed_max_size :1000, //default maximum file size in KB 

allowed_extensions :"jpg,png" //default allowed file extensions 

});

Note: Here ".required" is the element selector you can use your own

Use html code as below :

<input type="text" name="sample_text" class="required" >

You can apply custom options like inline css as below:

If you want to display error message in perticuar element :-

<input  type="text" name="sample_txt" class="required"  ang-options="display-id:my_div">
<div id="my_div"></div>

If you want to display custom error message :-

<input  type="text" name="sample_txt" class="required"  ang-options="msg:This is my custom error message;">

If you want to apply email validation :-

<input  type="text" name="sample_txt" class="required"  ang-options="email:true">

If you want to call custom function :-

<input  type="text" name="sample_txt" class="required"  ang-options="custom-function:my_func;">

If you want to apply file validaton with many options :-

<input  type="file" name="sample_file" class="required"  ang-options="allowed-ext:jpg,png;allowed-size:29000;msg:Please Select File;msg-ext:Please Select jpg or png File;msg-size:file size exceed">

List Of Custom Options :