Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Friday, July 31, 2009

SetFocus()

When I login to the multiple websites, I'm impatient. Impatient of the jazzy flash to load, for the Ads to be fetched. As soon as I see the Username and Password fields get rendered, I start typing and hit Enter. Many of you would have encountered this problem. When one starts typing the password, the client sets the focus in the Username text box. Result, I end up typing the password in clear text. More over, it gets cached by the browser.

So yeah,
1) Is there a way to avoid this late focus? Can't the code be written to set the focus as soon as the component is created!
2) Is it a problem with the code or the browser?
3) How about making Username text box also masked with "*" character. When one can type long passwords with special characters correctly, (s)he can very well type the Username correctly.
4) Why does this late focus happens? Technically!!

P.S. I've got three UI developers in my home. :-)

Update: psankar commented a cool tip,
one thing that you can do after this has happened is, you can do a shift+del, to delete that entry alone from autocompletion list.

Many people dont know this and end up clearing full history.

Wednesday, January 28, 2009

IRCTC again

In the republic day quiz at office they asked, what does IRCTC stands for? Indian Railways Catering and Tourism Corporation Limited. This year many of the holidays fall either on a Monday or Friday. So effectively for souls like me I would get change to be at home for 3 continous days. (but for that first you should plan to go..) You need to book ticket for these weekends as soon as ticket booking opens 90 days in advance in train. 

But be carefull when you book at real crunch times. Take this scenario.
7:45: Out of bed, ticket booking opens at 08:00 hrs.
7:50: Logged into IRCTC site. Waiting...
7:59: Ok, I remember the details and I will type everything fast and say book. 
8:00:30: Ok started typing and clicked book. 
MessageBox("Tickets can be booked only after 08:00 hours.");
8:05: Try again
 MessageBox("Tickets can be booked only after 08:00 hours.");
8:07: Logoff
8:09: Login again. :)
8:10: Show availability of tickets.. It said WL 120. 

Thanks to Srihari to debug and find this design issue. Problem was... Once you Login, the client browser pulls the system time and stores it. So Login into IRCTC at 7:50 is same even after 10 minutes. The clock does not ticket. So it fails on the client side validation on the browser. Ideally, it should be tied up with Sys Clock after getting the initial time from server. Fix it boss. Work around for now is to refresh the browser.