Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to access value in a textbox in one frame from other in javascript?

    how to access value in a textbox in one frame from other in javascript?
    phani

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    textboxValue = top.frames["FrameNameHere"].document.formNameHere.textboxNameHere.value

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript

    sorry sir, it's not working. it showing an error message saying that

    "object does not support this property or method"

    textboxValue = top.frames["FrameNameHere"].document.formNameHere.textboxNameHere.value

    can u please verify and send me again

    phani.
    phani

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    did you change the names (in bold) into corresponding ones?

    textboxValue = top.frames["FrameNameHere"].document.formNameHere.textboxNameHere.value

    please post the exact code you are using.

  • #5
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript

    yes sir i have got it. i have changed the object names before only even though i made a small mistake.

    can u help me in coding of java server pages. i have used the following code for "jsp2.jsp"

    <html>
    <body>
    <form name="form1">
    <input name=text1 value="hello">

    <%
    String s=request.getParameter("text1");
    out.println(s);
    %>
    </body>
    </html>

    when iam running this it is running null value. if i includes the following tag it first returns null after pressing the button it is returning the value. why is it?

    <input type=submit onsubmit="jsp2.jsp">
    phani

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    you can only request the value of a textbox when the form is submitted.
    in your case, when the page first loads, request.getParameter will return null because there is no post/get data submitted, only then when you click submit (which submits to the same page, in your case), request.getParameter("text1") will return its value.

    btw, what's the connection of this problem to your javascript problem?

  • #7
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    jsp

    sir, there is no connection between them. this is a different problem iam getting. then how to retrieve a value from a textbox in jsp with recalling the same form
    phani

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts

    Re: jsp

    there is no JSP forum here....
    but i'll answer you just the same.

    in your jsp2.asp:

    <%
    String s=request.getParameter("text1");
    if (s==null) s="";
    %>
    <html>
    <body>
    <form name="form1" action="jsp2.jsp" method="post">
    <input name=text1 value="hello" value="<%=s%>">
    <%
    out.println("This is what you entered: "+s);
    %>
    <input type=submit value="Submit">
    </form>
    </body>
    </html>

    but going back to your javascript problem, did you solve it using my suggestion?

  • #9
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile javascript

    thank u sir, for u reply. i have solved the javascript problem.
    when iam pressing the reply button to send reply for u it is asking to login again even though i have logged in before. why it is so? send the remedy.
    phani


  •  

    Posting Permissions

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