Document.CreateElement in IE5

Results 1 to 3 of 3

Thread: Document.CreateElement in IE5

  1. #1
    Thor1212 Guest

    Default Document.CreateElement in IE5

    Does anyone know why this code doesnt work in IE5. It works well in IE5.5,But i get an error in 5.0 saying invalid argument.This is a window that contains an IFrame called AvaCrew which contains a Select box called lstAvailable.<BR><BR>In IE5.0 the strOption.text and strOption.value contain values. the Function bombs on the add.<BR><BR>Any help would be greatly appreciated<BR><BR>TIA<BR><BR><BR>**************** ***********************************************<BR >function MoveToAvailable(objLst){<BR> if (objLst.selectedIndex != -1) {<BR> var strOption = document.createElement("OPTION");<BR> strOption.text = objLst(objLst.selectedIndex).text;<BR> strOption.value = objLst(objLst.selectedIndex).value;<BR> parent.parent.AvaCrew.lstAvailable.options.add(str Option) ;<BR> objLst.remove(objLst.selectedIndex);<BR> }<BR> }<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Document.CreateElement in IE5

    &nbsp;<BR>newitem = value to enter<BR>myObj = select menu name<BR><BR>first = eval("document.form1."+myObj)<BR>second = eval("document.form1."+myObj+".length")<BR>first[second] = new Option(newitem, second);<BR><BR>i have been trying to get the new value to be the selected one but i am having trouble, can you help?

  3. #3
    Thor1212 Guest

    Default RE: Document.CreateElement in IE5

    it would be easier to answer if i saw all of your code. if you insert the value into the first position (index 0) then you should be able to say, Listbox.selectedIndex.item(newitem).select.<BR>oth er wise i cant say because i havent seen your code you are using but i hope this leads you in the right direction

Posting Permissions

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