php - Programmatically creating forms - default selected index of a select -
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