listbox in browser prob

Results 1 to 3 of 3

Thread: listbox in browser prob

  1. #1
    m j s Guest

    Default listbox in browser prob

    I&#039;ve a problem with my page in ASP that occurs only in netscape. My technique works fine in explorer 5.5.<BR><BR>I have three listboxes say lb1, lb2 & lb3.<BR><BR>lb1 is populated automaicaly with values from a database. Each item in lb1 has some related items in the same table in the DB. now as soon as the user clicks on an item in lb1 the lb2 is populated with the values related to that item in the the DB. Now i&#039;ve the lb2 populated with items related to item clicked in lb1 so that the user may select items in lb2 & add them in the lb3. This is done by selecting item(s) in lb2 & clicking a button (ADD TO LIST) which has an onclick event which calls a Javascript function that ihave made called addtolist().<BR><BR>This thing works abs fine in explorer 5.5 & all the items selected by the user in lb2 are added in the lb3. But in netscape when i click the button (ADD TO LIST) although the values are added in the array i&#039;ve used but they are not shown in the listbox. although in explorer 5.5 all the vlues added in lb3 do appear in the listbox after the button is clicked. I&#039;ve also tried the show() & the display method but nothing works.<BR>Does anyone have any idea wat the prob might be & wat could be the solution?<BR><BR>Reply soon<BR>Thanx<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Netscape 4.x doesn't really....

    .. support this, however NN6 does. <BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: listbox in browser prob

    I use this, I remember it being a pain to get it to work in both browsers, I&#039;ve tested in Netscape 4+ and IE:<BR><BR><BR>// Get the new value from the listbox:<BR>var NewValue = document.forms.UserPrefs.SystemFields.options[document.forms.UserPrefs.SystemFields.selectedInde x].value<BR><BR>// Check they have selected something<BR>if (NewValue!="undefined"){<BR>// Add a new option<BR> document.forms.UserPrefs.TreeBranches.options[document.forms.UserPrefs.TreeBranches.options.leng th] = new Option(NewValue);<BR>// Enter the new value in the new option<BR>document.forms.UserPrefs.TreeBranches.op tions[document.forms.UserPrefs.TreeBranches.options.leng th-1].value=NewValue<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