Iphone/Ipad number format css style change in safari

Here's something interesting yet simple to share for a long time. If you are wondering and debugging countless hours for a very simple thing such as color change on a number format in ipad or iphone, you might just arrived to the correct blog post. We all know that debugging CSS and HTML in ipad or iphone isn't an easy task although we can emulate the environment, there are certain things we cannot emulate such as the behavior of the ipad or iphone OS itself. Interestingly, a client of mine faced such issue with their website where his 'contact' number listed on his website was changed to blue instead of white as declared on the css file when view on ipad or iphone.

Now, the odd thing is that even the emulator is showing the colors correctly. Debugged for a few hours without any luck but notice that  whenever i added alphabet into the numbers, it changes back to the correct colors. I though it was some javascript but it wasn't. In the end, i disabled the whole CSS and notice something different on the emulator and the ipad. Weirdly, ipad and iphone treat numbers as a link because it can be a contact on safari. Therefore, it automatically  wrapped around a group of numbers with an anchor link on a web page.  Therefore, your CSS declaration have to write something like

.style{
color: blue
}

and added something like

.style, .style a{
color: blue
}

if you wish to cater to ipad or iphone on your website. Even if you do not have a mobile stylesheet, ipad or iphone will still behave this way. Therefore, for any group of numbers on your website, just take note of such behavior on mobile devices such as iphone or ipad.

Add additional value before ajax call when using Yii CAutoComplete

If you are like me who wish to add an additional value into Yii CAutoComplete and wondering how this can be done, it is pretty simple thanks to Ron Lavie. Assuming, you have the default ajax call on your controller which is "$_GET['q']", now, you would like to get a new value to be included into your controller called "$_GET['f']" and you are wondering what to do in order to get your value into Yii CAutoComplete before it fires ajax call to your controller, this is how you should do it.

'extraParams'=>array('f'=>"js:function(){return $(\"#f\").val();}"),

Using the extraParams, we can add in additional field before an ajax call to the controller. Here's a full illustration.

      $this->widget('CAutoComplete',
          array(
             'value'=> $text,
             'name'=>'nanny_name',
             'id' => 'nanny_name',
                         //replace controller/action with real ids
             'url'=>array('/task/admin/autoCompleteNannyLookup'),
             'max'=>10, //specifies the max number of items to display
                         //specifies the number of chars that must be entered
                         //before autocomplete initiates a lookup
             'minChars'=>1,
             'delay'=>500, //number of milliseconds before lookup occurs
             'matchCase'=>false, //match case when performing a lookup?
                         //any additional html attributes that go inside of
                         //the input field can be defined here
             'htmlOptions'=>array('size'=>'40'),
             'extraParams'=>array('f'=>"js:function(){return $(\"#f\").val();}"),                                                                                   
             'methodChain'=>".result(function(event,item){\$(\"#updateValue\").val(item[1]);})",
          )); 
    ?>  

Now, whenever something is filled up on this CAutoComplete, it will search for the value in id "f" and included into variable "f" before firing up the ajax call to your controller. 🙂

“You do not have sufficient permissions to access this page.” Unable to access WordPress

Well, if you are unable to access your WordPress installation and received the message "You do not have sufficient permissions to access this page.", it is most likely that your WordPress installation, upgrading or migration has been screwed and the access of your user has all been lifted. In order to restore all these, you will need a bit of work to get it started again. However, there are still temporary solutions which you can undertake to make it work which doesn't completely solve your problem but temporary allow you to access WordPress. Just managed to get it working for a client so for all others who are seeking for a solutions as well, hope the tips help. Good Luck 🙂