Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Cmaskedtextfield And Network Ip Or Mask

$
0
0
Hey everybody, just wondering how to do a mask for IP adresses or netmask. For moment I didn't do better than something like :

 $this->widget('CMaskedTextField',
  array('model'=>$model,
  'attribute'=>'mask',
  'charMap'=>array('2'=>'[0-2]|','5'=>'[0-5]|'),
  'mask'=>'255.255.255.255'));


It works approximately... indeed, this mask constraints user to write for every part of the netmask 3 characters... thus any possibility to write something like 255.255.255.0 but 255.255.255.000 which looks weird and not natural... and I found no other way to do it... any idea ? :)

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>