sermon
(Mat Bl)
August 25, 2010, 7:00am
1
Hej Guys.
I have a drop down list, which is created out of a directory.
now i want to get the selected value of the drop down list and send it back to my form.
this is my view:
<?php
$this->pageTitle = Yii::app()->name.' - Upload';
$this->breadcrumbs = array('Backend','Upload');
echo CHtml::form();
echo CHtml::dropDownList('pc', 'value', $list);
echo '<br />';
echo CHtml::submitButton('Upload');
echo CHtml::endForm();
?>
Can anybody help?
sermon
(Mat Bl)
August 31, 2010, 5:59am
2
how can i read out the data of the dropdownlist which belongs to a value?
xicath
(Xicath)
August 31, 2010, 6:20am
3
hi.
did you mean its like popup form or transfer select ??
maybe like this one
http://www.mattkruse.com/javascript/popupwindow/
look at selectbox example.
sermon
(Mat Bl)
August 31, 2010, 8:02am
4
no i dodnt have a pop up.
it’s just a drop down box.
like this:
Now, if i select for exampe the PC-PANEFF.xml, this value should be transfered to my UploadForm via StieController.
But not only the text “PC-PANEFF.xml” Also the content should be transfered. Because in my UploadForm i got a function named xmlParser. And now guess what this function do
xicath
(Xicath)
August 31, 2010, 8:32am
5
Well, i think you just need js trigger like onchange ->go to submit to send the value to your form.
since you know the xml filename via post, you can add your xml parser then.
maybe someone will help you with js code or just google it. (i not good in js)
something like this
<script language="JavaScript">
function jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
<select style="width:50px;font-size:12px" onchange="jumpMenu('parent',this,0)">
<option value='http://mysite.com?value=name1_xml'>name1_xml</option>
<option value='http://mysite.com?value=name2_xml'>name2_xml</option>
</select>
i dont know, you have some quite interesting idea there,
maybe the xml parser will split each xml value for each field value in your form, isn’t it?