to this: to this:
 
Previous Thread
Next Thread
Print Thread
Rate Thread
#224373 09/10/2002 11:50 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
In your config.inc.php file add this variable:

$config['onload'] = "";



In your ubbt_header.tmpl file change this:

<body>

to this:

<body {$config['onload']}>



LOGIN
======================================================================
Now to place the cursor in the Username box during login you will need to edit your login.tmpl and change this:

<form method="post" action="{$config['phpurl']}/start_page.php">

to this:

<form name="userLogin" method="post" action="{$config['phpurl']}/start_page.php">


Now in your login.php script, just above this:

$html -> send_header($ubbt_lang['LOGIN_PROMPT'],$Cat,0,0,0,0);

add this:

$config['onload'] = "onload="document.userLogin.Loginname.focus()"";
======================================================================





NEW POST
======================================================================
In your newpost.php script just before this:

$html -> send_header("{$ubbt_lang['MAKENEW_HEAD']} ($Title)",$Cat,0,$user,$Board);

add this:

$config['onload'] = "onload="document.replier.Subject.focus()"";
======================================================================





NEW REPLY
======================================================================
In your newreply.php script just before this:

$html -> send_header("{$ubbt_lang['REPLY_HEAD']} ($Title)",$Cat,0,$user,$Extra,$ReadPerm);

add this:

$config['onload'] = "onload="document.replier.Subject.focus()"";
======================================================================





There's more scripts that you can use this with. Just make sure the form has a name and follow the same steps above but adjusted for what ever form/page your changing.



Edit Note: I had an error in the LOGIN code. The form's name should have been "userLogin"

Last edited by JustDave; 09/10/2002 12:25 PM.
Sponsored Links
Joined: Mar 2000
Posts: 21,080
Likes: 3
I type like Navaho
I type like Navaho
Joined: Mar 2000
Posts: 21,080
Likes: 3
very handy, thanks


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Your Welcome

(funny the things I can think of when I need them) LoL

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
What exactly does this do?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
It will place the cursor into the desired textbox of the form.

When you enter the login page you wont have to use the mouse to highlight the Username field so you can enter your info because it already is.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Oh cool.

I saw a post at Infopop community about "focus" and I thought "is it blurry".

DUH! - see I can't keep the "smart" facade up forever.

Thanks!

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
I added this to my index page yesterday and a user pointed out that when logged in, you get an error on that page.

Is there a way around this error? To only choose to do the focus event when the login box is up?

Thanks.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 253
Joined: January 2000
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 3429
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 4
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)