artis Posted December 13, 2005 Report Share Posted December 13, 2005 (edited) Tātad jāpieļauj tikai ciparu un komata ievadi Tik tālu tiku, ka var ievadīt tikai ciparus: if(cipari.value.match(/\D/) {...} Tātad, kā atļaut arī komata ievadi ? Un vēl - lai tas komats nebūtu sākumā un, lai nebūtu divi komati ? Edited December 13, 2005 by artis Link to comment Share on other sites More sharing options...
v3rb0 Posted December 13, 2005 Report Share Posted December 13, 2005 varēj tak pameklēt.. http://php.lv/f/index.php?showtopic=3023 Link to comment Share on other sites More sharing options...
[Ya] Posted December 13, 2005 Report Share Posted December 13, 2005 (edited) paprovee cipari.value.match(/\d+,\d+/) tb taisi 2 question if(cipari.value.match(/^\d+$/) || cipari.value.match(/^\d+,\d+$/)) { ... } šitā būs pareizi Edited December 13, 2005 by [Ya] Link to comment Share on other sites More sharing options...
AcidRain Posted December 13, 2005 Report Share Posted December 13, 2005 Ja tev vajag ciparus ar komatu vai punkti pārbaudīt, tad vari paņemt is_numeric. Tur tikai vajag pievērts uzmanību set_locale, kas noteiks vai ir punkts vai komats. Link to comment Share on other sites More sharing options...
artis Posted December 13, 2005 Author Report Share Posted December 13, 2005 varēj tak pameklēt.. http://php.lv/f/index.php?showtopic=3023 Šito biju sameklējis, tik nobijos no tiem key`iem, bet liekas -tīri sakarīgs [Ya] - nestrādā :/ AcidRain - man vajag JS Link to comment Share on other sites More sharing options...
AcidRain Posted December 14, 2005 Report Share Posted December 14, 2005 Ui, piedod, nepamanīju, ka tas bija JS. Link to comment Share on other sites More sharing options...
[Ya] Posted December 14, 2005 Report Share Posted December 14, 2005 reku piemeers ar manu skriptu redzeesi ka straadaa http://ya.dnet.lv/1123.html Link to comment Share on other sites More sharing options...
artis Posted December 14, 2005 Author Report Share Posted December 14, 2005 ' date='2005. gada 14. Dec 17:06' post='29354']reku piemeers ar manu skriptu redzeesi ka straadaa http://ya.dnet.lv/1123.html Hmm, jocīgi, tiešām strādā ... man strādāja (nepilnīgi), kad d nomainīju uz D ... nu labi, ņemšu vērā, paldies par atbildēm Link to comment Share on other sites More sharing options...
Recommended Posts