Help - Search - Members - Calendar
Full Version: Lost focus on a textbox IE7
HTMLHelp Forums > Programming > Client-side Scripting
Reine C.
Hi biggrin.gif

I've been reading your forum and I decide to join 'cause I have a "big" problem.

I have this listbox, once I click on an option it displays a textbox and some other listboxes that the user must fill, etc. The textbox and the latest listboxes are just hidden (I use display:none).

Well the very first time I do this at IE7 it works perfect but if I close the window (it's a pop-up) or click "Cancel" (which just closes the pop-up too) and try to enter this section again IE/ won't let me write on the textbox AT ALL unless I refresh the whole page. The only way to make it work again without refreshing is move around the controls with tab, but that's a problem for user who doesn't know about this key, etc.

This happened to every textbox on the application: it works the first time, the it didn't unless I refreshed or used the tab key. But I could fix them (after reading hours and hours) by setting the focus on the textboxes, which (thanks God) are the first controls the user should work with. But I couldn't do the same with the hidden textbox sad.gif it appears and I have to do what I mentioned above: refresh or use the tab key to see the cursor or write in it.

So the question is: is there a way to set focus on a hidden textbox so that when I have to show it the cursor is there??? or do you have another way to fix this IE7 error (about the textboxes that won't let me type in them)??

Btw, it works perfect in Firefox with or without the "fix" about the focus.

Thanks a lot in advance smile.gif
pandy
I don't know. Can we have a URL to a sample page go with that? smile.gif

I suspect you have to focus it after it's unhidden, but as said, I really don't know.
Reine C.
Oh man I can't give you a link sad.gif it's a job thing, the product isn't released yet so I can't sad.gif

But how would I put the focus on it after I revealed it.

Thanks for answering smile.gif
pandy
Put the focus stuff after the show stuff.
Reine C.
I did and it doesn't do anything sad.gif
Reine C.
Done!!! biggrin.gif

I was using the method in thw wrong place tongue.gif. I added it after "unhiding" the textbox and it works perfect smile.gif

Thanks a lot smile.gif
pandy
It worked? Go me! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.