Игнорируется параметр maxlength

360
08 января 2017, 16:23
<form>
<input class = 'reg' id = 'log' placeholder = 'Логин' style = 'display:none'  maxlength="16"></input>
<input class = 'reg' id = 'pass' placeholder = 'Пароль' style = 'display:none' type = 'text' maxlength="10"></input>
<input class = 'reg' id = 'rep' placeholder = 'Повторите пароль' style = 'display:none' type = 'password'></input>
</form>

CSS

.reg {
position: absolute;
padding: 10px;
margin-left: 300px;
border-radius:10px;
box-shadow: 0 1px 0 #ccc inset;
transition:500ms all ease;
width: 150px;
}
.reg:hover {
width: 180px;
}
#log {
margin-top: 150px;
}
#pass {
margin-top: 200px;
}
#rep {
margin-top: 250px;
}
  • Position:absolute мне нужен, т.к. элемент я помещаю на canvas. В чем собсна проблема.

  • style='display:none' на определенном уровне преобразовывается в style='display:block'

Параметр maxlength тупо игнорируется, не смотря на maxlength="12" я могу вводить любое количество символов. В чем проблема, что мешает?

Заранее благодарен за ответ)

Answer 1

input - одиночный тег (не закрывается) :

.reg { 
position: absolute; 
padding: 10px; 
margin-left: 300px; 
border-radius:10px; 
box-shadow: 0 1px 0 #ccc inset; 
transition:500ms all ease; 
width: 150px; 
} 
 
.reg:hover { 
width: 180px; 
} 
 
#log { 
margin-top: 150px; 
} 
 
#pass { 
margin-top: 200px; 
} 
 
#rep { 
margin-top: 250px; 
}
<form> 
<input class = 'reg' id = 'log' placeholder = 'Логин'  maxlength="16"> 
<input class = 'reg' id = 'pass' placeholder = 'Пароль' type = 'text' maxlength="10"> 
<input class = 'reg' id = 'rep' placeholder = 'Повторите пароль' type = 'password'> 
</form>

READ ALSO
Съезжает dropdown [требует правки]

Съезжает dropdown [требует правки]

Съезжает dropdown при открытииНе могу понять почему

349
Deserialization Problem [требует правки]

Deserialization Problem [требует правки]

Подскажите у меня exception(End of Stream encountered before parsing was completed) при десериализации объекта в клиент-серверном приложении на сервереКлиент:

385
C#.Заполнение DatagrirView

C#.Заполнение DatagrirView

Всем приветНа данный момент заполняю грид методом Add()

355
ASP.NET Identity Session timeout продлить сессию

ASP.NET Identity Session timeout продлить сессию

Всем приветСтолкнулся с такой вот проблемой: Необходимо продлить сессию пользователя до максимально возможной

452