Monday, February 21, 2005

Disabling Enter Key (JavaScript,ASP.NET)

Just a Question I came across browing one of my forums;

Q. How do I disable the enter key?

A. Well its just a piece of code which goes like this :

function modifKey(e)
{
var modif='';
if (event.altKey)
{
modif+='[ Alt ] ';
}
if (event.ctrlKey)
{
modif+='[ Ctrl ] ';
}
if (event.shiftKey)
{
modif+='[ Shift ] ';
}
getKey(e,modif);
}
function getKey(e,modif)
{
if (e.keyCode)
{
keycode=e.keyCode;
}
else
{
keycode=e.which;
}
char=String.fromCharCode(keycode);
xCode=char.charCodeAt(0);
if (xCode == 13) //Enter key is pressed!!
{
window.event.keyCode = 0;
}
else
{
return true;
}
}


So as you can see, we are trying to catch the enter key and return true if any key except the enter key is pressed!

Since we want this to work for the whole page, put this is the body tag of the page :

<~body MS_POSITIONING="GridLayout" onkeypress=' return modifKey(event);'>~<~/~body~>~
Note: Take off the ~ (cant put HTML tags here.. courtesy of google)

There you go, enter key disabled. :)

Saturday, February 19, 2005

The Brain Test (Fun)

Took another of the Tickle tests... This is the result.. I think the downside part is quite true... :-


You are Balanced-brained



That means you are able to draw on the strengths of both the right and left hemispheres of your brain, depending upon a given situation.

When you need to explain a complicated process to someone, or plan a detailed vacation, the left hemisphere of your brain, which is responsible for your ability to solve problems logically, might kick in. But if you were critiquing an art opening or coming up with an original way to file papers, the right side of your brain, which is responsible for noticing subtle details in things, might take over.

While many people have clearly dominant left- or right-brained tendencies, you are able to draw on skills from both hemispheres of your brain. This rare combination makes you a very creative and flexible thinker.

The down side to being balanced-brained is that you may sometimes feel paralyzed by indecision when the two hemispheres of your brain are competing to solve a problem in their own unique ways.


Tuesday, February 15, 2005

O2 Xda II Mini

Bought an O2 mini PPC-Phone yesterday. I must say I had some reservations about buying a PDA phone.My kind CTO gave me a hp PDA(not PDA phone) to play around with last year when I told him about my interest in buying a PDA phone. After using that PDA for some time, I realised that PDA wasn't really of much use to me.One of the major factors was because of the size, I didn't like keeping it with me always, and if your PDA is not with you always, I dont think its of much use. You dont expect someone to come home and put down all the details in his/her PDA just becuase he/she didn't carry it along!Because of all these factors, I went and bought myself a Nokia 6630 16 days ago, just because nokia advertised 6630 as an 'office phone'.6630 had some features, but none of them matched the 'office phone' image that nokia potrayed. I would say its more like a semi-multimedia phone. One of the things that I realised after buying the O2 mini is that its very difficult for a phone to be an 'office phone' without a stylus!I was very dissapointed about my decision of spending so much and buying a phone that didnt achieve any purpose for me.At last(yesterday), I couldn't keep the guilt of my misjudgement inside me any longer and sold my 6630, toped up, and bought an O2 Mini.And it's amazingly superb! Now this is what you can call an office phone.Yes I had all these features in the PDA too... But who carries that giant around? and who will keep on pulling it out from the bag(i.e if u decide to carry it in your bag)? call me lazy but the PDA that my CTO gave me to use (which is still with me except for demo times) is dead IF NOT used everyday.. And me who use to carry Nokia 6600 can't carry another big device on me..And now that I have that whole PDA ( and a lot more ) inside my phone, ahhh.... swweeeeeet!!Have to thank my CTO for letting me have the PDA to test out! :)
Go for O2 mini !
Cheers!

This page is powered by Blogger. Isn't yours?

© Copyright 2005, Rohan Thomas
Disclaimer
This Blog contains findings that are self-explored and expressions that are self-evoked. They are by no meanss representions of my employer's view.