Hi
i tried this regular expression ^(?:\00|9)[. ()-]*(?:\d[. ()-]*){8,14}$
to enter a phone number in a text field ,but it didnt work like i wanted .
what i want the rule to be is if the phone number starts with 9 then the length would be 8 digits, but if the phone number starts with 00 it would 14 in length on the same regular expression , the expression i found takes all the cases, like if it starts with 9 it could be 14 in length and vice versa !
the problem is that the phone number takes two forms in one input if this was on 2 input fields this would be much easier.
can any one help me with this ?
thats my code ... i used form validation to validate my form .
also if i can expand the rule a bove like this if i want to start with 123 and length 20 or any like this .
<input type="text" class="txt" id="mob_num" data-validation="custom" data-validation-regexp="^(?:\00|9)[. ()-]*(?:\d[. ()-]*){8,14}$" data-validation-error-msg="please enter the correct number" />
<script> $.validate(); </script>
Thank you :D