Click here to Skip to main content
14,545,210 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am develop political site, so i need validation of voter id in my project.
Posted
Updated 22-May-20 22:41pm
Comments
Prasad Avunoori 14-Feb-14 3:43am
   
You would need a Webservice/WCF service which is provided by Chief Election Officer of Your country.
Ahmed Bensaid 14-Feb-14 4:01am
   
Do you know all the forms that can be take by this id ?
Member 10596107 15-Feb-14 2:35am
   
http://erms.gujarat.gov.in/
Ahmed Bensaid 15-Feb-14 8:48am
   
If you know the exact form that can take this voter id, you should use a regular expression to validate it.
   
What have you tried? What is the format of voter id in your country?
Please research and come out with some code.
Member 10596107 15-Feb-14 2:44am
   
in my website user registration for member that time they insert voter id.
so i need to check, a user register is valid or note.
iko1365xxx something like this voter id in India
give me a suggestion and how can use web services in my project for voter id.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

function validateVoterID(ths) {
    var inputvalues = $(ths).val();
    var regex = /^([a-zA-Z]){3}([0-9]){7}?$/g;
    if (!regex.test(inputvalues)) {
        $(ths).val("");
        $(ths).parent().append('<span class="error">Invalid Voter ID Number</span>');
        return regex.test(inputvalues);
    } else {
        $(ths).parent().find(".error").remove();
        return true;
    }
}

<input type="text" name="voter_IDno" class="form-control" onchange="return validateVoterID(this)" placeholder="Enter Voter ID Number" maxlength="10">
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100