user852610
user852610

Reputation: 2265

passing value joomla

I have this selectbox and I want to pass the value selected

I have this in my view

<form id="search-restaurant"  method="post" action="<?php echo JURI::root()?>index.php/hardware/buscarCategoria">
<?php 
echo JHTML::_('select.genericlist', $options ,'myfilter','onChange="this.form.submit()"','value','text');     
?>
</form>

I take the value seleted like this

$input=JFactory::getApplication()->input;
$value=$input->get('myfilter');

the value is correct but I do a print_r or echo of value

 print_r($value); 

I obtain 0combo or 1combo why the combo works, it is ok??

Upvotes: 0

Views: 75

Answers (1)

Jobin
Jobin

Reputation: 8282

Are you looking for something like this.

http://docs.joomla.org/API16:JHtmlSelect/options

You can pass the $selected argument with proper value,It will set the default list option for you.

Upvotes: 1

Related Questions