NetTalk Web Server > Web Server - Share Knowledge

Making "focus" work in a nested popup

(1/1)

Jane:
My problem was an input field on a form nested several popups deep.  I wanted the field to have focus when the form opened but it wasn't working.

This is a follow-up to Bruce's help on today's webinar.

1. We were fooling ourselves in the console.  The console itself grabs focus, so typing
$("#bruce").focus();
actually DID work, but one needed to click back into the browser part of the screen for it to take effect.  (Unlike the .hide() and .show() commands).

2.  I guess "timing is everything".  I tried moving the focus() command to inside the embed that is inside the $(document).ready function and now it works!  (pic).  Apparently what I tried previously was firing too early.

Thanks, all.

Jane


Bruce:
ahh =- thanks for the feedback Jane - makes sense...

Navigation

[0] Message Index

Go to full version