-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vValue option does not work correctly with selecter setting field type #9
Comments
This is the intended behavior and it's not a bug. For the select field type, you need to specify Try changing it to:
This would select the second option item as PHP arrays are zero-base. Optionally, you may use an associative array for the
|
Thanks for taking the time to show that. I hadn't looked at the result of Again, many thanks, although i spent some time on this you have still have Pete On Wed, Oct 16, 2013 at 2:10 AM, michaeluno notifications@github.comwrote:
|
Not a problem. It is appreciated that you took the time to explain your issue and presented it in detail so that it gives me a clue what is confusing for the users. This helps when a new feature gets implemented. I'll be more careful to design the code and write the documentation. I would avoid code structures that is told it could cause confusion. If you encounter a confusing part in the code or the documentation, feel free to submit a better one. This library is merely a work of an individual whose native language is not English. Contributions are always appreciated. |
Can be quickly reproduced by adding 'vValue' array to the selecter demo in "admin-page-framework-demo.php".
$this->addSettingFields(
array(
'strFieldID' => 'test_drpdwn_2',
'strSectionID' => 'test_fields',
'strTitle' => 'Options - 2',
'strDescription' => 'some more options but with vValue set',
'strType' => 'select', // Single Drop-down List
'vDefault'=> 2,
'vValue' => array ( 'first option', 2 , 'etc option' ),
'vLabel' => array ( 'first option' , 'next option' , 'etc option' ),
)
);
Adding the vValue optional array causes the 'selected="selected"' option tag in the output option field to remain fixed on the value=0 option, the vValue field does not seem to have taken effect either. Any calls to this value result in 0 until the vValue field is removed. I have tried using intergers, strings and different orders.
The text was updated successfully, but these errors were encountered: