0

hola ando buscando una solución al pattern="[01-31]{2}" obviamente el código no lo iba a poner completo pero esa parte es la que causa problemas y no lo pretendo arreglar con JS ni con data ni <select option> tenéis alguna idea, si rescribes ese código veras errores.

Problemas Técnicos

7th Sep 2016, 6:43 PM
System engineer
System engineer - avatar
9 Answers
+ 2
http://code.sololearn.com/W8WZ5vndC1Ok <div class="fecha-de-nacimiento"> <h4>Fecha de nacimiento</h4> <input type="tel" id="tel" name="dia" pattern="0[1-9]|[1-2][0-9]|30|31" maxlength="2" placeholder="Dia" required title="Dia">/ <label type="dia" for="dia"> </label> <input type="tel" id="tel" name="mes" pattern="0[1-9]|1[0-2]" maxlength="2" placeholder="Mes" required title="Mes">/ <label type="mes" for="mes"> </label> <input type="tel" id="tel" name="ano" pattern="19[4-9][0-9]|200[0-9]|201[0-6]" maxlength="4" placeholder="Año" required title="Año"> <label type="ano" for="ano"> </label> </div> Wouldn't comboboxes (created by using <select>) be better for the job, though?
7th Sep 2016, 8:59 PM
Zen
Zen - avatar
+ 2
I don't really understand what you are saying, but are you looking for a regexp pattern to match a day of the month? pattern = "0[1-9]|[1-2][0-9]|30|31"; Edit: I forgot to exclude 00.
7th Sep 2016, 7:26 PM
Zen
Zen - avatar
+ 2
Here is an example with dropdown menus. http://code.sololearn.com/W8DlCWt5jmJN
7th Sep 2016, 9:46 PM
Zen
Zen - avatar
+ 1
en teoría reglamentaria ese código tendría que por dado a sus características debe de ser del 01 al 31 sin problema pero dado a la comprobación con CSS en : required:valid, focus:invalid me di cuenta si saben algo no duden en hablar GRACIAS.
7th Sep 2016, 6:49 PM
System engineer
System engineer - avatar
0
yes
7th Sep 2016, 7:20 PM
System engineer
System engineer - avatar
0
<div class="fecha-de-nacimiento"> <h4>Fecha de nacimiento</h4> <input type="tel" id="tel" name="dia" pattern="[0-2][0-9]|30|31|]{2}" maxlength="2" placeholder="Dia" required>/ <label type="dia" for="dia"> </label> <input type="tel" id="tel" name="mes" pattern="[0-2]|01|12]{2}" maxlength="2" placeholder="Mes" required>/ <label type="mes" for="mes"> </label> <input type="tel" id="tel" name="ano" pattern="[0-4][0-9]|1940|2016]{4}" maxlength="4" placeholder="Año" required> <label type="ano" for="ano"> </label> </div>
7th Sep 2016, 8:28 PM
System engineer
System engineer - avatar
0
this is what I'm trying corregilo if there is something wrong because you help me a lot with that Zen
7th Sep 2016, 8:31 PM
System engineer
System engineer - avatar
0
okey thanks but the above was helpful
7th Sep 2016, 9:56 PM
System engineer
System engineer - avatar
- 1
ok thanks I appreciate the support (Zen)
7th Sep 2016, 9:05 PM
System engineer
System engineer - avatar