php - Programmatically creating forms - default selected index of a select -


'limiter'] = array ('#type' = & Gt; 'Select', '#id' = & gt; Limiter, '# Option' => Array ('10 '=>' 10 ', '25' = & gt; 25 ', '50' = & gt; '50 '));

That works fine.

However, how do I define the default selected index, so '25' is selected when the page is loaded? Whatever I pass through '#default_value' does not seem to work.

Any advice appreciated!

It happens via #default_value - if that does not work , Then there is another problem with your code for your attached snippet. Note that #default_value will work only on the first load of the page; After this, the value chosen by the user will be overridden. $ String ['limiter'] = array ('#type' = & gt; select ',' #id '= & gt; array ('10' = & gt; ' 10 ',' 25 '=> '25', '50' => 50;), '#default_value' => Seismic, '#options' => 25');

View


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -