Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2006, 10:04 AM
Authorized User
 
Join Date: Nov 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Window.Focus()

Scenerio:

A parent Window contains a popup window which has the virtual keyboard from which you can type in a textbox in parent window.

when i refresh the parent window then i am not able to type from the poped up window (virtual keyboard).

i want to set the focus back to the textbox in parent window, so that i can type from the popup window in the text box.

how can i do it ?

i used onload()=window.focuc(); but is not working !



payab
__________________
payab
 
Old December 9th, 2006, 02:49 AM
Registered User
 
Join Date: Nov 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 hi rahimzai,

 you can try this
if you are using the texbox inside a form>>>>
<body onload="document.form1.textboxname.focus();">
<form name="form1">.........

if you are using the texbox inside a body>>>>
<body onload="window.textboxname.focus();">


this should work!!!

thanks ,

Mohan K


If debugging means removing errors ..... Then programming is its oppoiste word...!!!!
 
Old December 11th, 2006, 08:27 AM
Authorized User
 
Join Date: Nov 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks but it is not working
i think when i get the focus on the textbox in the parent window it works but when the parent window is refreshed ( re-loaded ) then the popuped keyboard window is disconected from it so it cannot input in the textbox in the parent window. so i think i have to put somthing in the body tag of my parent window to focus over the popup window after re-loading. can i do this !?

rahimzai

payab
 
Old December 20th, 2006, 09:12 AM
Registered User
 
Join Date: Nov 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i couldnt get you ...


how you are opening up that popup window ?

is it onload of the parent window or onclick some link/button/image you are opening that popup?

if it is onload then it will work naturally... if it is on click of some thing then there is problem... :((


each time you have to check each time and then set the focusess accordingly


may be you can use
mywindow=window.open("child.html")
mywindow.focus();





Similar Threads
Thread Thread Starter Forum Replies Last Post
force popup window focus srcLakeJake Javascript 2 May 22nd, 2008 11:33 AM
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Channel Mode and Window focus interrupt Javascript How-To 0 May 10th, 2006 02:45 AM
Ultimate Window Focus fs22 Javascript 1 April 16th, 2005 06:56 AM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.