Submit data by pressing enter - submit

I've developed log in page in my project and I want to submit log in credentials when user presses enter key directly.
(Now in the page user has to click on submit via mouse after typing ID and PASSWORD)
So can anybody help me how can I use it using javascript or any other way ?

If your "input" elements are in a "form" element, pressing [Enter] should automatically submit the form... Like if you click on the button with the type="submit".
If you're asking to submit a form without having a submit button, here is a possibility submitting-a-form-by-pressing-enter-without-a-submit-button

Related

Login form vs Login Dialogue - Delphi Application

For a mobile phone application, would it be better to have a login form (I'm thinking would be the main form), which when you pass authentification would take you to the "MainPage" form, or a login dialog which opens before the main form and only allows the main form to open if it passes authentification?
My thoughts would be as a mobile app, if you log out, you don't necessarily want the entire app to close therefore having the login form as the main form, would be there (keeping the application alive) until you want to fully close it. And vice versa, with the login dialogue, since the main form is once you've logged in, when you log out you'd close that form as you don't have access to it, and therefore close the app.
it is better to make the main form with a TPageControl with some pages, the first will occupe the password and others the app things.
when you verify the password, you can pass to other tabs.

Refresh Registration page after submitting

In my site, I have made a registration page named registration.php. When I submits it redirects to reg_success.php. But If i press back button after my succesful registration, then also the registration page i.e registration.php remains filled. I want that if my registration is complete and I press back on browser then my registration page should come blank.
Kindly help me, what code I need to add to the registration page on clicking back on browser.
Use following line of code :
window.location.reload();
or also you can use following way :
window.location.href = window.location.href;

logout does not work properly in struts2

i am developing a struts project.
In login page action stored username and password in session.
In logout action class using session.invalid and removed that session details and redirected to index page.
But i click back button in browser it goes to the previous page.
Now i need sample code for if i am clicking back button after logging out it will show the error message or it display index page like yahoo mail.
need sample for that in struts2
As I know, very hard to do JS side. because back button belong to web browser. Our project do below way:
When logout, close currently window and open new window. that will help you clear history.

Making user follow another user can get its twitter username

I have a button on my website which says "Follow"
When a user clicks on this button I want the following to happen:
Twitter login window opens
User enters user/password and logs in
User has now started following
That login window now closes (or a close button clicking on which closes the window) and user is back on my website and I get its twitter username through some API which user just entered so I can insert it in my database.
Is this possible?
What I want to achieve is, I want to get username of users who follow me and save them in database.
In case #penartur's answer doesn't work for you, you may want to look at: https://dev.twitter.com/docs/intents/events. Although I have to admit that I've never used it : )

Open email link in an existing open window

We send out a confirmation email on completed registration. User need to click a link to confirm the registration, this link opens up a new window. Bog standard procedure...
How can I get the new window to open up in the existing window (or close the old window)?
[Update, not sure if I was clear enough.]
When I click on the confirmation link I want it to open or replace the window I still have open from the registration process.
You can't control the user's email client (and this is a good thing), so you cannot direct how it opens links.
You could use a script on the "old" page (the one used to enter email address, profile details, etc.) to poll your server and do something once registration is confirmed. If the user closes this page before that happens, e.g. opens another link on the site, this works well by not moving them where they don't expect.
The user would still have the registration page open, so simply put instructions on that along the lines of "email address confirmed, would you like to now 1) do this, 2) that, or 3) something else" (all links).
Use the target="_top" attribute, i.e.
linktext
That will solve your problem

Resources