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?

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

can use the same code in a textbox instead of a button
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.