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 ...});
Related
I have a custom button on my webpage that i like to assign a FB login to.
The custom button (JS handler):
<div class="button_wrap">
<a class="button_aLeft" id="button_aLeft"><span></span></a>
<a class="button_bLeft slidebttn" id="button_bLeft">Login<span></span></a>
</div>
Because the Facebook button holds a pretty long code i posted it on jfiddle:
Facebook button
Is it possible to assign the login action to the custom button?
Use login method of the JS SDK and run it onclick on your own button image ect.
http://developers.facebook.com/docs/reference/javascript/FB.login/
Ive been trying to figure out how to get some data i type into a text field to save on the screen underneath it. Something like a twitter, or Facebook news nothing fancy. I'm using JQM and would like this to get save on the same page as the text field and button under the
<div data-role="content">
This is what i have for a field and button.
<input type="text" id="Text"/>
<input type="button" id="Button" value="Submit" />
<div id="buttonPlaceHolder"> </div>
and this is some javaScipt i found to go along with the button, it works however the dollar signs screw up JQM and ive tried putting it in its own js file. I think i might be doing something wrong.
$('#Button').bind('click', function() {
$('#buttonPlaceHolder').append($('#Text').val());
// refresh jQM controls
$('#home').trigger('create');
});
If at all possible id like the javascript in with the html via script
I am not sure if I understood the question. Nevertheless try this, it may help:
<!DOCTYPE html>
<html>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph.</p>
<p id="myDIV">A DIV.</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML="Hello Dolly";
document.getElementById("myDIV").innerHTML="How are you?";
}
</script>
</body>
</html>
It is a html page example. You can find more info and useful examples here:
http://www.w3schools.com/js/js_examples.asp
If you want to save it for later use, try localStorage mechanism.
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.
Can anyone shed some light to this situation: I have a link that opens in a modal, i add a link and a button that are set to go to the same url. If i click the link, the modal goes to the link, and shows the article properly. If i click the button, it shows the article embedded on the page.
Here's the url, click on newtest2
http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=category&id=1&Itemid=2
Here's the code
<head>
<script type="text/javascript">
function change_url(){
window.location.href="http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=article&id=1:newtest&catid=1:test&Itemid=2"
}
</script>
next
</head>
<body>
<button onclick="location.href='http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=article&id=1:newtest&catid=1:test&Itemid=2'">Next</button>
</body>
</html>
There is a apparent difference, being that the link calls window.location, while the button just sets location, but this is semantically the same.
That popup you got is created by JavaScript. So the link is just used for its url, but when you click it, a script gets executed that loads the content asynchronously and shows it in a popup.
This script does not affect the button (though it could). Find the script that does this and apply it to the button too.
A workaround could be:
<a href="http://zaazoolive.thewebbusters.com/index.php?option=com_content&view=article&id=1:newtest&catid=1:test&Itemid=2">
<button></button>
</a>
Edit: Although it's working, is not a recommended code, as HTML spec clearly says that using tag for item is invalid, so treat this ONLY as a workaround.
P.S. Why are you using <a></a> in section head?
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;
}