Jump to content
php.lv forumi

Recommended Posts

Posted

Kā ar html panākt to lai minimālai ievadāmie simboli ir 5.. -

Zinu ka maksimālo var uzlikt ar maxlength, bet lkm tāds minlength nav..- Vsmz man nedarbojas, ja ievadu.

Posted

tāpēc, ka nav tāda atribūta. Var izmantot JS, kas pārbauda, un tad php pusē,- ja nav pieci simboli, tad prasi, lai raksta vairāk.

Posted

Kā ar html panākt to lai minimālai ievadāmie simboli ir 5.. -

Zinu ka maksimālo var uzlikt ar maxlength, bet lkm tāds minlength nav..- Vsmz man nedarbojas, ja ievadu.

 

ar html to nepanāksi, tas jādara ar javascript.

 

Es ceru, ka tu saproti, ka php pusē tik un tā ir jāpārbauda garumi, jo html/js ierobežojumus var elementāri apiet.

 

<script>
<script>
function testLength(e){
if(e.value.length < 5 || e.value.length > 30){
 alert("Par īsu vai par garu");
}
}
</script>

<input type="text" onblur="testLength(this);"/>

Posted (edited)

Skaidrs.. - Viss tgd ok.. - Paldies.

Man jau nevajadzēja neko sarežģītu vnk vārdu ievadīšanai.. ;)

Edited by ashais13

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...