如何使用 GET 作为表单的一部分从 Office UI 结构下拉列表中获取选定的值到 php?
使用下拉列表作为提交表单的一部分,尝试从多选复选框下拉列表中获取所选值到 php 中,以进一步将它们插入到数据库中。
感谢所有帮助!
`
<script>
//Dropdown
"use strict";
const { IStackTokens, Stack, Dropdown, DropdownMenuItemType, IDropdownStyles, IDropdownOption,
ThemeProvider, initializeIcons } = window.FluentUIReact;
// Initialize icons in case this example uses them
initializeIcons();
c
onst dropdownStyles = {
dropdown: { width: 850},
};
const options = [
{ key: 'h1', text: 'Main Category', itemType: DropdownMenuItemType.Header },
{ key: 'M1', text: 'Research' },
{ key: 'M2', text: 'Earnings update'},
{ key: 'M3', text: 'Strategy'},
{ key: 'M4', text: 'ESG'},
{ key: 'M5', text: 'Other'},
{ key: 'divider_1', text: '-', itemType: DropdownMenuItemType.Divider },
{ key: 'h2', text: 'Enviremental', itemType: DropdownMenuItemType.Header },
{ key: 'E1', text: 'Biodiversity' },
{ key: 'E2', text: 'Climate change/GHGs' },
{ key: 'E3', text: 'Deforestation and land-use' },
{ key: 'E4', text: 'Oceans' },
{ key: 'E5', text: 'Water' },
{ key: 'E5', text: 'Other environmental issues' },
{ key: 'divider_1', text: '-', itemType: DropdownMenuItemType.Divider },
{ key: 'h3', text: 'Social', itemType: DropdownMenuItemType.Header },
{ key: 'S1', text: 'Gender equality and diversity' },
{ key: 'S2', text: 'Human rights, labour rights and childrens’ rights' },
{ key: 'S3', text: 'Indigenous peoples’ rights/local community' },
{ key: 'S4', text: 'Product safety and quality' },
{ key: 'S5', text: 'Other social issues' },
{ key: 'divider_1', text: '-', itemType: DropdownMenuItemType.Divider },
{ key: 'h4', text: 'Governance', itemType: DropdownMenuItemType.Header },
{ key: 'G1', text: 'Board structure' },
{ key: 'G2', text: 'Corruption' },
{ key: 'G3', text: 'Remuneration' },
{ key: 'G5', text: 'Tax' },
{ key: 'G4', text: 'Other corporate governance' }
];
const stackTokens = { childrenGap: 20 };
const DropdownBasicExample = () => {
return (React.createElement(Stack, { tokens: stackTokens },
React.createElement(Dropdown, { placeholder: "Select category", multiSelect: true, options: options, styles: dropdownStyles })));
};
const DropdownBasicExampleWrapper = () => React.createElement(ThemeProvider, null,
React.createElement(DropdownBasicExample, null));
ReactDOM.render(React.createElement(DropdownBasicExampleWrapper, null),
document.getElementById('content'));
console.log(Object.keys(obj));
</script>
`