i want to create a script in which if user clicks on any text box area then automatically new url should open.
can anyone knows that code?

thank you .
LVL 10
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


<INPUT type="button" value="New Window!" onClick="'','mywindow','width=400,height=200')">

can use the same code in a textbox instead of a button

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
In case plusone3055's post wasn't clear... all you need to do is add the onclick atttribute to your textbox:


If you want this to also happen if someone tabs into the field, you may instead want to use "onfocus" rather than "onclick".
d4durveshAuthor Commented:
hi, i thanx both of you for your kind replay's.

yes it is working when i tried onclick attribute but not when i use onfocus . it shows that firefox is preveting to open a new pop-up box.

any idea why it showing that??
Firefox's pop-up blocker is preventing the pop-up because, well, that's what it is supposed to do.

For onfocus - you probably don't want to do that anyway... use a browser that lets the popup work... watch what happens when you click the popup - you'll get two (one for the onfocus and one for the onclick) - watch what happens when you close the last popup... you'll get another popup (because that box/button/etc has now regained focus).
d4durveshAuthor Commented:
thanx both of you. :-) good day tc
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.