我想将数据从多选(右侧)输入到数据库,我使用 Gentelella 模板中的默认表单智能向导,从多选中获取数据我做函数:
function selectAll(theSel) {
var selLength = theSel.length;
for(i=selLength-1; i>=0; i--) {
theSel.options[i].selected = true;
}
}
我添加了这个:
<form class="form-horizontal form-label-left" action="<?=site_url('index.php/biodata/commit'); ?>" method="POST" onsubmit="selectAll(document.getElementById('region_id_assign')); selectAll(document.getElementById('region_out_id_assign')); return;">
并将代码 onfinish 更改为 true :
$.fn.smartWizard.defaults = {
selected: 0, // Selected Step, 0 = first step
keyNavigation: true, // Enable/Disable key navigation(left and right keys are used if enabled)
enableAllSteps: false,
transitionEffect: 'fade', // Effect on navigation, none/fade/slide/slideleft
contentURL:null, // content url, Enables Ajax content loading
contentCache:true, // cache step contents, if false content is fetched always from ajax url
cycleSteps: false, // cycle step navigation
enableFinishButton: false, // make finish button enabled always
hideButtonsOnDisabled: false, // when the previous/next/finish buttons are disabled, hide them instead?
errorSteps:[], // Array Steps with errors
labelNext:'Next',
labelPrevious:'Previous',
labelFinish:'Finish',
noForwardJumping: false,
onLeaveStep: null, // triggers when leaving a step
onShowStep: null, // triggers when showing a step
onFinish: true // triggers when Finish button is clicked
};
如何解决让数据进入数据库?
抱歉,我这次是新手尝试使用智能向导