Jump to content
php.lv forumi

Length


ashais13

Recommended Posts

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);"/>

Link to comment
Share on other sites

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...