Results 1 to 2 of 2

Thread: [RESOLVED] A little javascript help

  1. #1

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Resolved [RESOLVED] A little javascript help

    Hi all

    I'm trying to pass back values to my opening form. Like this
    Code:
    Dim scr As New StringBuilder
                scr.Append("opener.document.forms[0].")
                scr.Append(lblEMTextTarget.Text)
                scr.Append(".value ='")
                scr.Append(ddEM.SelectedItem.Text)
                scr.Append("';")
                scr.Append(lblEMHiddenTarget.Text)
                scr.Append(".value ='")
                scr.Append(ddEM.SelectedItem.Value)
                scr.Append("';")
                scr.Append(lblCSTextTarget.Text)
                scr.Append(".value ='")
                scr.Append(ddCS.SelectedItem.Text)
                scr.Append("';")
                scr.Append(lblCSHiddenTarget.Text)
                scr.Append(".value ='")
                scr.Append(ddEM.SelectedItem.Value)
                scr.Append("';window.close();")
                btnSetValues.Attributes.Add("onClick", scr.ToString)
    I'm sending client id's in a querystring and saving them in label controls on the popup.

    I'm sending 4 values back to the opener. It sends and sets 1 value and then errors off. The error is

    Code:
    Microsoft JScript runtime error: 'ctl00_ContentPlaceHolder1_GridView1_ctl02_hdEM_Edit' is undefined
    If I remove all but one (any one), it works.

    Help!

    Thanks

  2. #2

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Re: A little javascript help

    Another "Duh" moment......

    I needed to repeat the whole command after each ";". The javascript was trying to assign value to controls that didn't exist on the popup.

    My bad

Posting Permissions

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



Click Here to Expand Forum to Full Width