Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-16-2005, 11:03 AM   #1 (permalink)
brendalisalowe
Registered User
 
Join Date: May 2005
Posts: 9
brendalisalowe is on a distinguished road
won't focus and have error...[RESOLVED]

Can anyone see why this page is giving me an error and not focusing? By the way, I am a newbie

Code:
<HTML>
	<HEAD>
	<script language="JavaScript">
		function setFocus()
		{
		Document.Form1.txtUserName.focus();
		}
	</script>
		<title>Login</title>				
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">		
	</HEAD>	
	<body onload="setFocus();">
....................
I think this is giving me the error: <body onload="setFocus();">
Brenda

Last edited by brendalisalowe; 05-26-2005 at 12:10 PM.
brendalisalowe is offline   Reply With Quote
Old 05-17-2005, 11:34 AM   #2 (permalink)
brendalisalowe
Registered User
 
Join Date: May 2005
Posts: 9
brendalisalowe is on a distinguished road
I figured it out.

Form1.txtUserName.focus();

instead of:

Document.Form1.txtUserName.focus();
brendalisalowe is offline   Reply With Quote
Old 05-17-2005, 01:10 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
hmm .. does document work if you make the D lowercase?

i.e.: document.Form1.txtUserName.focus();

thanks for posting the fix.
__________________
Mike
sde is offline   Reply With Quote
Old 05-17-2005, 01:12 PM   #4 (permalink)
brendalisalowe
Registered User
 
Join Date: May 2005
Posts: 9
brendalisalowe is on a distinguished road
Yep, lowercase "d" works too. Cool!

I have another question too, if you have time:datalist disappears...why?
brendalisalowe is offline   Reply With Quote
Old 05-17-2005, 01:19 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
i don't know asp.net that well. i can't help there, sorry.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 02:02 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting