How to pass a value to a hidden field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Taftheman
    New Member
    • Nov 2006
    • 93

    How to pass a value to a hidden field

    Hi, i have an asp.net and vb.net web page i am opening a popup window where the user can select somthing. When the user presses select it is suppose to go back to the original form closing the pop up and processing the value the user has chosen. To do this i am using javascript. The problem is how to you tell the pop up to close and pass the value back to the hidden field in the oiginal form where i can do more processing.

    Sorry if this does not make sense
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    it does make sense ;) ... you just need to assign an onchange-event that sets the new selected value to a field in the opener's document. then just use the window.close() method to close the popup window ...

    please show what you have tried so far.

    kind regards

    Comment

    • Rsmastermind
      New Member
      • Sep 2008
      • 93

      #3
      Originally posted by gits
      it does make sense ;) ... you just need to assign an onchange-event that sets the new selected value to a field in the opener's document. then just use the window.close() method to close the popup window ...

      please show what you have tried so far.

      kind regards
      Hello friend window.close may not work in some case specially when you are working in the different frame of the parent page .So, It is always safe to use top.close which will close always the t window which is in the browser where you are working.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        thanks to point that out - of course window should refer to the window that should be closed ... you could use it in the parent window or in the popup itself ... so you always should know the correct reference

        Comment

        • Taftheman
          New Member
          • Nov 2006
          • 93

          #5
          Hi thanks for you replies. I have got most of it working however, i can't seem to pass a hidden field value to the js function the code is bellow

          Code:

          this.form.hdnSt ructureID.value

          can someone tell me whats wrong with this as this is the only place where it does not pass a value through. the hdnStructure is a hidden filed

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            could you search the page where you use this to check that your shown reference is correct? in the browser have a look at the source view, could you post that part of the html-page where this element is located?

            kind regards

            Comment

            Working...