From JScript Forum...

Results 1 to 2 of 2

Thread: From JScript Forum...

  1. #1
    Join Date
    Dec 1969

    Default From JScript Forum...

    This script works in IE. I have Javascript enabled in NS 4.7, still it does not execute. Anyone?<BR><BR>&#060;script type="text/javascript" language="JavaScript"&#062;<BR><BR> <BR>function doOp(alist)<BR>{<BR> var Op = &#039;&#039;;<BR> var ndx;<BR> ndx = alist.selectedIndex;<BR> Op =alist.options[ndx].text;<BR> <BR> if (Op == "sum")<BR> {<BR> alist.form.value.options[0].text = "Enr";<BR> alist.form.value.options[1].text = "FTE";<BR> alist.form.value.options[2].text = "Sections";<BR> } <BR> <BR> else if (Op == "Count")<BR> {<BR> alist.form.value.options[0].text = "Dept";<BR> alist.form.value.options[1].text = "Center";<BR> alist.form.value.options[2].text = "Load";<BR> alist.form.value.options[3].text = "Division";<BR> alist.form.value.options[4].text = "Center";<BR> alist.form.value.options[5].test = "Term";<BR> }<BR> else<BR> {<BR> alist.form.value.options[0].text = "Enr";<BR> alist.form.value.options[1].text = "FTE";<BR> alist.form.value.options[2].text = "Sections";<BR> }<BR>}<BR><BR><BR>&#060;/script&#062;

  2. #2
    Join Date
    Dec 1969

    Default I tried this 4 years ago...

    ...and it didn&#039;t work then, either.<BR><BR>You can&#039;t change the .text or the .value of an &#060;OPTION&#062; in NS 4.x (couldn&#039;t in MSIE 3, either).<BR><BR>You have to build an entirely new Option object.<BR><BR>You *might* have to rebuild the entire list of options again. I forget how far I had to go on that with NS 4.<BR><BR>Look at my and the "dual lists in JS" demo to see how to create new options. That code (last I checked) works with all browsers.<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