[ZPT] ZPT, Javascript
Tom Deprez
tom.deprez@uz.kuleuven.ac.be
Tue, 18 Mar 2003 17:35:37 +0100
okay,
I found a way (probably not the best), but I'm not completely there. :
<script type="text/javascript"
tal:content="structure
string:SelectArray=[['111','222','333'],['777','888','999']]">
</script>
<script type="text/javascript">
function updatePlacesList(theForm) {
var NumPlace = theForm.field_PlaceSelect.options.length;
var SelectedCampus = "";
while(NumPlace > 0) {
NumPlace--;
theForm.field_PlaceSelect.options[NumPlace] = null;
}
SelectedCampus =
theForm.field_CampusSelect.options[theForm.field_CampusSelect.selectedIndex]
.value;
if (1 > 0)
{
NumPlaces = SelectArray[0].length
for (i=1; i<=NumPlaces; i++)
{
theForm.field_PlaceSelect.options[i] = new
Option(SelectArray[0][i-1],SelectArray[0][i-1])
}
theForm.field_PlaceSelect.selectedIndex=1
}
}
</script>
In the first you see the definition of SelectArray. Now I need to make the
contents of a SelectArray comming from a Python Script. I tried several
things, but that doesn't work... what's the simplest way?
Thanks,
Tom.
Chris Withers wrote:
> Tom Deprez wrote:
>> Hi,
>>
>> Anybody an idea how to fill the contents of a selection list with
>> javascript according to the selected item in another selection list?
>> This in a Zope Page Template
>
> tal:attributes?
>
> cheers,
>
> Chris
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://mail.zope.org/mailman/listinfo/zpt