This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

focus not working

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Netscape 6 .
My servlet opens a popup window in a java script function and gives focus to newly opened popup window (windowname.focus() ).
After this line I am saying form.submit() in same function.
Now here is problem .....
New Servlet opens and gains the focus and I want focus on prev. opened pop up window..
One more thing .........
I want that code for opening popup window should be there in first servlet only as action property of form changes dynamically,so I can not open pop up window on 'onload' event of second servlet.

How can I do this ???
Please help me urgently
thanks in advance
ninad
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ninad
Your problem is probably because the function you use to open the new window and call submit is in one window and the form is in another. Try something along the lines of windowName.formName.submit().
hope that helps
Dave
 
ninad parkhi
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi dave,
I am not getting ur point :-(
can u just elaborate a bit ...
that might help me
thanks
ninad
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't worked with servletts yet but I don't think it's a servlett issue.
On the first page you have a javascript function that opens a new window and gives it focus. Then you call formName.submit().
when you say formName.submit() you are trying to submit a form on the same page as the javascript function. What you need to do is teel the function that the form you want to submit is on the new page that you just opened. To do this use the name of the new window that you opened in front of the submit().
it would look something like this:
newWin = window.open(location, "newWindow", features);
newWin.focus();
newWin.document.formName.submit();
that way it knows that the form to submit is in the new window.
hth
Dave
 
Die Fledermaus does not fear such a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic