1

I want to validate 7 alphanumeric for 1 part of my form but it keeps telling me to follow the format even when I usepattern="[a-zA-Z0-9]".

Here is my code :

<div class="control-group form-group">
    <div class="control">
        <label for="admin">Admin Number:
            <input type="text" class="form-control" id="admin" name="admin" placeholder="eg. 123456A" required pattern="\[a-zA-Z0-9]{7}"/>
        </label>
    </div>
</div>

and just asking but is it possible to validate radio box without javascript

3
  • Why \[ instead of [? Commented Aug 10, 2015 at 16:48
  • I deleted it but it still keep saying Please match the requested format Commented Aug 10, 2015 at 16:50
  • @Norman - What is the value are you using that fails validation? Commented Aug 10, 2015 at 16:52

1 Answer 1

1

I changed it to this and now it seems to be working:

<div class="control-group form-group">
<div class="control">
    <label for="admin">Admin Number:
    <input type="text" class="form-control" id="admin" name="admin"  placeholder="eg. 123456A" pattern="[0-9A-Za-z]{7}"/>
</label>
</div>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.