procmail
[Top] [All Lists]

Using array references in JavaScript

2003-08-07 07:03:24
This is a bit off subject but here goes...

Is it possible to use references to arrays in Javascript to affect the
contents of the 'options' array?

In my HTML form I have a select list and want to be able to change the
contents of the list using a javascript function depending on which radio
box the user presses the conents of a select box should change.  

I want to hold both sets of contents in their own array and then somehow do
this.....

<script language="JavaScript">
function set_select(choice) 
{
  var array1 = [1, 2, 3];
  var array2 = [6, 7, 8];
  
  if (choice == "A")
  {
    /* Set options to the list in array 1*/
    document.form.select.options = array1;
  }
  else if (choice = "B")
  {
    /* Set options to the list in array 1*/
    document.form.select.options = array2;
  }
</script>

I know this is not strictly CGI but I know that many of you will also be
experienced in JS so thought it worth a try.

Thanks in advance,

Tony.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>