I am using frameset in my html (GUI). My GUI consists of four parts header, footer, side navigation and content page.
Now I have provide a functionality for log out button in the header frameset. After redirecting the new JSP page is displayed only in the header not in the window (window still contains all the above framesets)
I want to display this new redirected page on the whole window.
You should do this at the client side.
<form action="/logout" method="post" target="_top">
<input type="submit" name="logout" value="Logout">
</form>
If one of the pages you redirect to shouldn't have the outer frames you can use javascript to break out
// run this javascript on the logout landing page and it will remove the frames
if (parent.frames.length>0){
parent.location.href=self.document.location;
}
Related
I have a nested HTML page as:
<html>
<body>
<div class="container">
<nav class="item_list">...</nav>
<article id="item_details">
<object type="text/html" data="detailsPage?key=document1">
<html>...</html>
</object>
</article>
</div>
</body>
</html>
Inside the main div (class="container") there's a item list on the left (nav class="item_list"). On the right side, it is an article with id item_details. Inside the article, it is a nested html page which shows the details of a selected item. In the nested html page, there's a form to add new item or delete an existing item. This action needs to refresh the nav part.
So my question is - how to refresh the nav part in response of a button click from the nested HTML page? More specifically, I'm using Vert.x as my server application toolkit, it the resolution is by Vert.X, it will be much more helpful.
Thanks in advance.
refresh the nav part in response of a button click from the nested HTML page?
Attach a button click listener as a javascript function
In that function make a request to your vert.x backend with the appropriate data
Return the new nav response you want from your vert.x backend
Use that data in javascript to refresh the nav part
Ps This has nothing to do with vert.x and is regular webapp design patterns
I have a webpage, which has an overall form element surrounding all the code on the page between the <body> ... </body> tags on the page.
As part of the webpage, there are two additional forms inside this to add and edit rows on a tables contained on the webpage.
How are the form elements handled on a webpage? Will the browser know what to process a webpage laid out:
<body>
<form id="FullPageForm">
Content here.
<form id="AdditionalFomr1">
Form1 elements only
</form>
<form id="AdditionalFomr2">
Form2 elements only
</form>
</form>
</body>
Can the browser isolate the various different form sections on the page correctly?
Having <forms> nested inside other <forms> is not valid in HTML4 or HTML5.
See the relevant part of the HTML5 Specification below:
4.10.3 The <form> element - Content model: Flow content, but with no <form> element descendants.
They can however, be siblings, e.g.
<form id="AdditionalFomr1">
Form1 elements only
</form>
<form id="AdditionalFomr2">
Form2 elements only
</form>
<form id="AdditionalFomr3">
Form3 elements only
</form>
Now that your forms are separated, it's easy to differentiate between what action should happen when each one is submitted etc.
it will not work. nested variables is not supported by any browser.
ya your code is working
but you have done silly mistake in above code
see in tag you used '?' instead of '>' sign
and put forms in a table form
so you can get formal look
I want to develop a login HTML page that will contain both signup and sign-in buttons . In the HTML page at run time i have the option to select any of the button (sign-in/sign-up). On clicking on the signup the page should redirect to a Signup JSP program and by clicking on sign-in page the page should redirect to a login Servlet program . Now The problem is that which page(JSP/SERVLET) I have to mention in action method of form in html page. ? How to resolve this issue?
You can just insert text
example:
Sign In
Sign Up
It should be simple hyperlink [GET], You don't need to submit form for that
<!--sign in button code -->
<!--sign up button code -->
If you want to use button then you have to go through jQuery or javascript events such as onClick of the button. here is few example. exactly what you need. You dont need to do that by form action submit.
<html>
<head>
<script>
function open_win()
{
window.open("http://yoururl.com");
/*or
window.location.href = "/yourpathToPageOrServletIfany/yourfiel.jsp.html.phpOrYourServletMapping";
*/
}
</script>
</head>
<body>
<input type="button" value="Open Window" onclick="open_win()">
</body>
</html>
the same thing is possible with the jquery $('#buttonId').click(function(){...in here ...});
So i'm submiting form with jquery to ifram like this $('.form').submit() here is my iframe and form html
<form id="upload_image_form" src="#" target="iframeTarget" method="post" enctype="multipart/form-data"></form>
<iframe class="iframe" src="<?=url::base()?>user/upload_image/" name="iframeTarget"></iframe>
So when i load page i get my iframe load right page but when i submit my form iframe for some reason loads the same page i'm on not the user/upload_image why is this happening, maybe my form or iframe is incorrect?
You have to set your form action attribute to user/upload_image.
Does the iframe id need to also be set to "iframeTarget"?
And i think Dmitry is right, you need an action to post back to. Don't src is needed.
I have a website which splits the screen into two frames; the top half is the name of my website; the bottom half is an advertised website.
I want it so if the user clicks the link on the top half (my website) the user is taken to my homepage.
This works, but my website is loaded into the top half and not the whole screen.
How do I get the link to remove the frames and display my website in the whole browser.
Here's what I'm talking about:
http://www.thefacebookies.com/advertise.php
Have tried target="_top" which doesn't work.
Many thanks.
You have:
<a onClick="window.location ='bet.php'" target="_top">
That should be:
<a href="bet.php" target="_top">
Don't use JavaScript when HTML will
do.
The target attribute doesn't influence assignments to window.location
<A HREF="http://www.xyz.com" TARGET="_top">
"_top" loads the linked document in the topmost frame, that is, the new page fills the entire window.
See
target Property
From javascript you can
parent.location = new location;