Unable to Read/Set Text Box in ASPX Web page using Javascript

Discussion in 'Software' started by rameshk75, Oct 25, 2006.

  1. rameshk75

    rameshk75

    Joined:
    Oct 25, 2006
    Messages:
    1
    Hi,

    Am using the below code to popup a modal dialog box.
    I got the value back from the child window to the parent window.
    Now i want to assign the value to one of the text boxes on the parent window.

    Before that i was just checking the value in the text box and am getting an error message that document.form... is null or object not reference.

    Can someone help me out in reading and setting the value to/from the parent page's text box.

    I have tried with many combination of the javascript like:
    document.forms[0].elements[txtTitle].value
    document.form1.txtTitle.value

    and few others....


    Here is the code

    *****************************************************
    Response.Write(" <script language=""javascript"">")
    Response.Write(" {")
    'Response.Write(" var strReturn; strReturn=window.showModalDialog('child.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');if (strReturn != null) document.getElementById('txtTitle').value=strReturn;")
    Response.Write(" var strReturn; strReturn=window.showModalDialog('child.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');")
    Response.Write(" alert(document.frmMaterialRequest.elements[txtTiltle].value); }")
    Response.Write(" </script>")
    *********************************************

    Thanks in Advance.
    rameshk75, Oct 25, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Naga_01
    Replies:
    0
    Views:
    1,358
    Naga_01
    Jun 6, 2006
  2. Hijabi
    Replies:
    1
    Views:
    676
    Headhuntar
    Sep 29, 2006
  3. sureshsekaran
    Replies:
    1
    Views:
    1,293
    sureshsekaran
    Oct 18, 2006
  4. Armando Ruiz

    default.aspx or login aspx?

    Armando Ruiz, Jun 22, 2004, in forum: MCAD
    Replies:
    0
    Views:
    421
    Armando Ruiz
    Jun 22, 2004
  5. getmeaditi
    Replies:
    0
    Views:
    1,671
    getmeaditi
    Mar 10, 2009
Loading...

Share This Page