XAJAX+SMARTY+PHP表单Select取值问题
小弟正在使用XAJAX+SMARTY做一个小工具。
但是现在遇到一个棘手的问题!
问题如下:
从一个Select(1)中选择一个,产生Select(2),Select2可以多选,并且随其新增Button一项,
现在我想点击Button后获得select1单个值,Select2中的多个值XAJAX传入并用其他函数进行处理。
应该如何处理?下面是部分代码段~submit(button)部分是重点,请高手解决我自己也正在解决中。
function GetFieldsFromTable($tablename){
global $tbinfo;
$xajaxresponse = new clsxajaxresponse();
if(isset($tablename) && isset($tbinfo) && is_array($tbinfo) && array_key_exists($tablename, $tbinfo)){
$xajaxresponse->addRemove("fields_src");
$xajaxresponse->addRemove("submit");
$xajaxresponse->addCreate("form1", "select", "fields_src");
$xajaxresponse->addAppend("fields_src","size",count($tbinfo[$tablename]->GetFields()));
$xajaxresponse->addAppend("fields_src", "multiple","");
foreach ($tbinfo[$tablename]->GetFields() as $key=>$value){
$xajaxresponse->addAddOption("fields_src", $key, $key);
}
$xajaxresponse->addCreate("form1", "button", "submit");
$xajaxresponse->addAppend("submit", "value", "ShowTableInfo");
$xajaxresponse->addEvent("submit", "onClick", "xajax_GetInfoFromFields(form1.tables.value)");
}else{
$xajaxresponse->addAlert("ReadError!".__FILE__."Line:".__LINE__);
}
return $xajaxresponse->getXML();
}