GM_config

By JoeSimmons Last update Feb 26, 2011 — Installed 1,031,679 times.

Select elements not loaded with pref

in
Subscribe to Select elements not loaded with pref 2 posts, 2 voices



spunit262 Scriptwright
FirefoxWindows

Select elements are not loaded with preferences (they default to the first option) when using an object literal (ex { 'value1':'display1', 'value2':'display2' } ), but they are when using an array literal (ex ['value1', 'value2'] ).

I would also like to request the ability to use object literals for radio groups.

 
JoeSimmons Script's Author
FirefoxWindows
spunit262 wrote:
Select elements are not loaded with preferences (they default to the first option) when using an object literal (ex { 'value1':'display1', 'value2':'display2' } ), but they are when using an array literal (ex ['value1', 'value2'] ).
Fixed. You can now use _def : "some option" here's an example I test with:
			work:{
					section: ['Work',
							  'What do you work as?'],
					label: 'Job',
					type: 'select',
					options:{
					carp:'Carpenter',
					truck:'Truck Driver',
					porn:'Porn Star'
					},
					_def: 'Porn Star'
					}
spunit262 wrote:
I would also like to request the ability to use object literals for radio groups.
Why? An array seems fine, what would be different with an object literal?
Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel