javascript - How to allow only Hebrew letters in input for mobile page, and few more questions? -
i little bit new html , php programming wondered if there way following things :
i have input html code should full name of person.
<form action="createname.php" method="post"> <input dir="rtl" name="fullname" type="text" placeholder="שם פרטי + שם משפחה" /> <button style="width: 100%;" class="button block green" type="submit" id="login"> המשך לאפליקצייה</button> </form>
this code supposed mobile devices, , want know if there away allow hebrew letters in code ? tried few things didn't work maybe because on mobile not sure, have ideas ?
strange thing happens person start typing inside input, mobile keyboard shows input stays in same position instead of going above keyboard, keyboard literally above input , person can not see typing inside, anyway change ?
the last question less impotent because work advice way works, thing this: there log in using facebook application website data given facebook not enough me , wrote code mentioned before because need have full name of person , in facebook name not 100% correct because users add nicknames , stuff facebook name. code working this, first person logs in facebook account redirected main page, why main page ? because there possibility user not new user , entered full name in first log in, in main page php script checking if user have entered full name , if not script redirecting him input page there filling full name. thing way works ? maybe there way smarter ?
thanks ahead :)
use regular expressions in order filter out non hebrew character.
<?php function leaveonlyhebrew($str) { $strippedstr = trim($str); return trim(preg_replace('#[^א-ת ]#i', '', $strippedstr)); } var_dump(leaveonlyhebrew("azאב azטו"));//only hebrew , spaces var_dump(leaveonlyhebrew("azxc gfh"));//empty ?>
Comments
Post a Comment