Javascript, <SELECT>, and frames

Results 1 to 2 of 2

Thread: Javascript, <SELECT>, and frames

  1. #1
    Join Date
    Dec 1969

    Default Javascript, <SELECT>, and frames

    Hello,<BR>I am working on a screen with a header and body frame, with a large list-box (&#060;SELECT&#062; tag) in the body frame.<BR><BR>I&#039;d like to be able to add a line in the list-box through javascrpit written on the header page, but I&#039;m having trouble. When I cut/paste the code to the body page, it works perfectly. Is there some sort of security function preventing scripts from one page to alter form elements on another? Both pages reside in the same directory on the same server. Any work-arounds?<BR><BR>I&#039;ve included the code below, thanks for your help! :)<BR><BR>-Michael-<BR><BR>function onAdd()<BR>{<BR> var lstScreen;<BR> var optOption;<BR> lstScreen = parent.main_right_bottomframe.ProfileForm.ScreenLi st;<BR> optOption = new Option();<BR> optOption.text = "Test Item";<BR> optOption.value = "TEST";<BR> lstScreen.options[lstScreen.options.length] = optOption;<BR>}

  2. #2
    Join Date
    Dec 1969

    Default Time to debug a little...

    Try something like:<BR><BR>function onAdd()<BR>{<BR>var lstScreen = parent.main_right_bottomframe.ProfileForm.ScreenLi st;<BR><BR>alert( "option 0 is " + lstScreen.options[0].text );<BR>...<BR><BR>*************<BR><BR>maybe you aren&#039;t addressing the frame correctly???<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