EllisLab text mark
Advanced Search
     
How to get the real value of a selected element
Posted: 05 October 2012 03:46 AM   [ Ignore ]
Joined: 2012-10-05
1 posts

Hi all, I was trying to get a value from a select tag html but I couldn’t get what i want; I got 0 in my final output:
Here is the codes:
<?php echo $year .’ :’.form_dropdown($year, $years).br();?> (it’s the view)

$data[‘year’]=‘Year’;
  $data[‘years’]=array(‘2007’=>‘2007’,
      ‘2008’=>‘2008’,
        ‘2009’=>‘2009’);
( the model)

I hope someone could help me to sort it out!

My kind regards!

Ranaivo

 
Posted: 07 October 2012 05:12 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-04-15
453 posts

@ranaivoo - your code is a little difficult to understand, you may need to post a more complete version of your code. Is the select box rendering correctly in the page, with values, name, etc?

if you use code tags it will help as well

 Signature 

Code By Jeff

Mahana Messaging Library

Problem with your query? Did you run

$this->db->last_query(); 

before you came to the forums for help?