• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Forms in Frame

 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have 2 Frames in a HTML page. In the second Frame, there is a form. When the form in the second Frame is submitted to a particular URL, does the entire HTML page or just the second frame change to that URL?
Thanks.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just the frame. I have a frameset like that. the left side is for navigation. the right side displays forms. the right side can change either from a link on the left side or submitting the form however the left side remains the same.
[This message has been edited by Randall Twede (edited September 07, 2001).]
 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following snippet in the second form:out.println("<HTML>");
out.println("<BODY>");
out.println("<FORM METHOD=\"POST\" ACTION =\""+response.encodeURL(chatRoomPath)+
"\" TARGET=\"_top\">");
out.println("<p>Enter your message:</p>");
out.println("<INPUT TYPE NAME=\"msg\" SIZE=\"30\">");

out.println("<INPUT TYPE=SUBMIT VALUE ='Send Message'>");
out.println("</FORM>");
out.println("<FORM METHOD=\"POST\" ACTION = \""+response.encodeURL(listRoomPath)+
"\" TARGET=\"_top\">");
out.println("<INPUT TYPE=SUBMIT VALUE=Exit>");
out.println("</FORM>");
out.println("</BODY></HTML>");
When I press the Exit button, the entire frame changed to listRoomPath.
Please help me understanding what is going on.
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cameron,
The reason the entire frame changes to listRoomPath is because the target on that form says "top".
I think it will work as you want if you have the target on that form as "self" i.e
<FORM METHOD="POST" ACTION=response.encodeURL(listRoomPath)
TARGET="_self">
Hope that helps.
Chuck

Originally posted by Cameron Park:
I have the following snippet in the second form:out.println("<HTML>");
out.println("<BODY>");
out.println("<FORM METHOD=\"POST\" ACTION =\""+response.encodeURL(chatRoomPath)+
"\" TARGET=\"_top\">");
out.println("<p>Enter your message:</p>");
out.println("<INPUT TYPE NAME=\"msg\" SIZE=\"30\">");

out.println("<INPUT TYPE=SUBMIT VALUE ='Send Message'>");
out.println("</FORM>");
out.println("<FORM METHOD=\"POST\" ACTION = \""+response.encodeURL(listRoomPath)+
"\" TARGET=\"_top\">");
out.println("<INPUT TYPE=SUBMIT VALUE=Exit>");
out.println("</FORM>");
out.println("</BODY></HTML>");
When I press the Exit button, the entire frame changed to listRoomPath.
Please help me understanding what is going on.


 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Randal and Chuck.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic