On javascript closed, cannot assign value to hidden textbox

Last post 07-03-2009 12:04 PM by agr001. 2 replies.

Sort Posts:

  • On javascript closed, cannot assign value to hidden textbox

    07-03-2009, 6:31 AM
    • Member
      30 point Member
    • ryanlcs
    • Member since 05-17-2007, 1:35 PM
    • Posts 238

    I hava a button to pop up a child window, on the event on close on that pop up window,  i will assign a value to a textbox on the parent window. After assign, i will close the child window.

    But I got problem, if the textbox on parent window is visible, i can assign the value, BUT if the textbox is not visible, I cant assign and close the child window, and I need that textbox to be invisible, please advice me.

    "window.opener.Form1." & _
    HttpContext.Current.Request.QueryString("ctrlNameHidden") & ".value = '" & _
    strDTM & "';window.close();"


     

    Thanks You.

     

  • Re: On javascript closed, cannot assign value to hidden textbox

    07-03-2009, 9:14 AM
    • Member
      141 point Member
    • charge22
    • Member since 07-03-2009, 9:40 AM
    • Posts 27

    Hi,

    I dont think assigning values to hidden text box is possible.

    Why dont you use hidden controls instead? I am sure it will work.

    Do let me know in either case.

    Cheers!

    ---------------------------------------------------------------------------------------------

    Please mark as answer if it helps!

    Cheers!

    ------------------------------------------

    Please mark as answer if it helps.
    Credits points for us and also lets others know its an accepted answer.
  • Re: On javascript closed, cannot assign value to hidden textbox

    07-03-2009, 12:04 PM
    Answer
    • Member
      313 point Member
    • agr001
    • Member since 01-04-2003, 1:49 PM
    • Posts 67

    You can use an asp:textbox control don't set it to visible="false" on the server.  Rather add a style attribute to set it's visibility to hidden.

    e.g. 

           ctrlNameHidden.Attributes.Add("style", "display:none;")
    

    put this in the page load event 

    Your could also use something like this

    <input type="hidden" id="ctrlNameHidden" runat="server">


    Hope this helps 

    Andrew

Page 1 of 1 (3 items)