March 10 2015

Joomla Page refresh function

Tagged Under :

Joomla
I have do the research with google and found that. Joomla itself don’t have refresh function for their application. But if I need do the refresh function with my component or module then how?

IN here, I found a simple way to let my application do the refresh with below code. and it work find in my component and module with Joomla 2.5.
$app = JFactory::getApplication();
$app->redirect(JUri::getInstance());

February 04 2015

Jquery simple dynamic dropdown options with PHP array

Tagged Under : ,

jquery
Dynamic dropdown options always use in our Application. It can be based on user first selection to return a new listing to second dropdown options by AJAX.

Below is the example PHP array script:
$option = array();
$option[] = array('name' => 'fruits', 'value' => 'f');
$option[] = array('name' => 'vegetables', 'value' => 'v');
$option[] = array('name' => 'pizza', 'value' => 'p');

And now we need the Jquery script to build the dropdown select. Below script are allow to reuse again when you need to replace the dropdown option again.

January 11 2015

Custom HTML Upload Button with CSS

Tagged Under :

css3
To change the HTML Upload Button css we need to create a new label for it. and then hide the current upload button.

The label is use for to let the user upload the file. But you still need to prepare the upload button inside your code. But it already hidden in interface.

<label for="uploadBtn">Choose File...</label>
<input type="file" id="uploadBtn">
<span id="filename"></span>
But before that, please make sure the label for name must same with the upload button id. So when the user click the label, it will pop up to select the file.

Below is the DEMO to show how it work:
Custom HTML Upload Button with CSS