You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
('form', 'This example illustrates the use of the `radio` type.
289
+
The `name` parameter is used to group the radio buttons together.
290
+
The `value` parameter is used to set the value that will be submitted when the user selects the radio button.
291
+
The `label` parameter is used to display a friendly name for the radio button.
292
+
The `description` parameter is used to display a helper text near the radio button.
293
+
294
+
We could also save all the options in a database table, and then run a simple query like
295
+
296
+
```sql
297
+
SELECT ''form'' AS component;
298
+
SELECT * FROM fruit_option;
299
+
```
300
+
301
+
In this example, depending on what the user clicks, the target `index.sql` page will be loaded with a the variable `$fruit` set to the string "1", "2", or "3".
'{"name": "fruit", "type": "radio", "value": 1, "description": "An apple a day keeps the doctor away", "label": "Apple"}, '||
305
+
'{"name": "fruit", "type": "radio", "value": 2, "description": "Oranges are a good source of vitamin C", "label": "Orange"}, '||
306
+
'{"name": "fruit", "type": "radio", "value": 3, "description": "Bananas are a good source of potassium", "label": "Banana"}'||
307
+
']'));
283
308
284
309
INSERT INTO component(name, icon, description) VALUES
285
310
('chart', 'timeline', 'A component that plots data. Line, area, bar, and pie charts are all supported. Each item in the component is a data point in the graph.');
0 commit comments