Hello Django Users,
I'm struggling with the newform options and i'm wondering if there is
a method that can update the values of a certain choicefield.
basically i have two choice fields. The selection of the first choice
field should generate values for the second choice field
in javascript i would do the following
var secondOptions =
{
1 :[['Beckman Coulter Electrachrom AT',101],['BioMerieux Chromostrate
ATIII',127]],
2 :[['Trinity / Biopool Spectrolyse ATIII (anti-Xa)',103],
['Chromogenix Coamatic Antithrombin',105]],
99:[['Chromogenix Coamatic Antithrombin',105]]
};
function UpdateSecondary( sel ){
var secondsel = document.getElementById('secsel');
var selvalue = sel.options[sel.selectedIndex].value;
var count = secondOptions[ selvalue ].length;
secondsel.options.length = 0;
for( i =0; i<count; i++)
secondsel.options[i] = new Option( secondOptions[selvalue][i]
[0],secondOptions[selvalue][i][1] );
}
<select name='assa_a' width='600' STYLE='width:150px'
onChange='UpdateSecondary(this);'>
<option value=1 CLASS='text'>Chromogenix, anti IIa</option>
<option value=2 CLASS='text'>Chromogenix, anti Xa</option>
<option value=99 CLASS='text'>Other</option>
</select>
<select id='secsel' name='meth_a'>
<option value=160>Renam Reachrom ATIII</option>
</select>
I was wondering if something like this is already incorporated in the
newforms or can this only be done by javascript ?
thanks in advance for your advice,
Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---