これは私のinput
要素です。私はそれが文字(数字または他の文字なし)だけを受け入れるようにしたい。HTML5パターンが検証されない
<input type="text" name="firstName" pattern="[a-zA-Z]" class="form-control" id="firstName" placeholder="First Name" required>
これは私の部分的な全体像です。私が使用しています
<form method = "post" action = "" ng-controller = "signUpCtrl as signUp">
<div class="form-group row">
<label for="firstName" class="col-sm-2 form-control-label">First Name</label>
<div class="col-sm-10">
<input type="text" name="firstName" pattern="[a-zA-Z]" class="form-control" id="firstName" placeholder="First Name" required>
</div>
</div>
<div class="form-group row">
<label for="middleName" class="col-sm-2 form-control-label">Middle Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="middleName" placeholder="Middle Name" required>
</div>
</div>
<div class="form-group row">
<label for="lastName" class="col-sm-2 form-control-label">Last Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="lastName" placeholder="Last Name" required>
</div>
</div>
<div class="form-group row">
<label for="dob" class="col-sm-2 form-control-label">Date of Birth</label>
<div class="col-sm-10">
<input type="date" class="form-control" id="dob" placeholder="Date of Birth" required>
</div>
</div>
<div class="form-group row">
<label for="userName" class="col-sm-2 form-control-label">User Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="userName" placeholder="User Name" required>
</div>
</div>
<div class="form-group row">
<label for="password" class="col-sm-2 form-control-label">Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="password" placeholder="Password" required>
</div>
</div>
<div class="form-group row">
<label for="confirmPassword" class="col-sm-2 form-control-label">Confirm Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="confirmPassword" placeholder="Confirm Password" required>
</div>
</div>
<div class="form-group row">
<label for="email" class="col-sm-2 form-control-label">Email Address</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" placeholder="Email Address" required>
</div>
</div>
<div class="form-group row">
<div class="col-sm-offset-2 col-sm-10 text-center">
<button type="submit" class="btn btn-lg btn-info submitButton">Submit</button>
</div>
</div>
</form>
- Google Chromeの50.0.2661.94(公式ビルド)メートル(32ビット)
あなたが取得している問題は何ですか? – siddhesh