Initialize select

Results 1 to 2 of 2

Thread: Initialize select

  1. #1
    Join Date
    Dec 1969

    Default Initialize select

    I&#039;m trying to dynamically change the select bx in a parent form. Also the syntax is correct for accessing the parent form but for adding options dynamically it crashes.<BR>Here&#039;s the code:<BR><BR> function change()<BR> {<BR> var IntPath = opener.document.userform.subtype;<BR> var TheOptions = IntPath.options.length;<BR><BR> IntPath.options.length = 0; <BR><BR> IntPath.options[IntPath.options.length] = new Option(&#039;His Hair is Cool&#039;,&#039;0&#039;);<BR> }

  2. #2
    Join Date
    Dec 1969

    Default You can't just set...

    ...the length of the options to zero.<BR><BR>You have to set the individual elements of the options array to null, working backwards.<BR><BR>I have a demo at that shows "Dual Lists in HTML" (or something akin to that) that demonstrates the technique. It works in MSIE and NS, incidentally.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts