473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Is this Java script?

GS
we are using the following script for cursor to goto default position,
is this script is java script or not?. can somebody tell me. I got this
script from Internet, our client told us not to use any Java script to
set the cursor to default position. Thanks in advance.

onload="document.login.userrname.focus();"

Oct 25 '06 #1
7 1517
GS wrote on 26 okt 2006 in comp.lang.javascript:
we are using the following script for cursor to goto default position,
is this script is java script or not?.
It is not Java Script, because Java has no script.

It is ..... Javascript.
That is the part between the "" is.

Without the ; it could also be vbscript in IE,
since in fact it is mainly DOM.
can somebody tell me. I got this
script from Internet, our client told us not to use any Java script to
set the cursor to default position. Thanks in advance.
Ignore him and do what you think best!

Chances are he will not pay, however, for being ignored. ;-}

onload="document.login.userrname.focus();"
More cross browser safe use:

<body
onload="document.forms['login'].elements['userrname'].focus();">


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 25 '06 #2

GS wrote:
we are using the following script for cursor to goto default position,
is this script is java script or not?. can somebody tell me. I got this
script from Internet, our client told us not to use any Java script to
set the cursor to default position.
If the client wants the curosr set to the default position then isn't
JavaScript the only way to do this?

Regardless don't do this unless you will take special care. I'm usually
half way through typing my password by the time the page loads. Then
the focus is changed and the last half of my password is typed in the
username field. So unless you are going to write code that looks for
what has already been typed and takes care of this situation don't
bother with the JavaScript to set focus.

Peter

Oct 25 '06 #3
Peter Michaux said the following on 10/25/2006 6:53 PM:
GS wrote:
>we are using the following script for cursor to goto default position,
is this script is java script or not?. can somebody tell me. I got this
script from Internet, our client told us not to use any Java script to
set the cursor to default position.

If the client wants the curosr set to the default position then isn't
JavaScript the only way to do this?
No.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 26 '06 #4

Randy Webb wrote:
Peter Michaux said the following on 10/25/2006 6:53 PM:
GS wrote:
we are using the following script for cursor to goto default position,
is this script is java script or not?. can somebody tell me. I got this
script from Internet, our client told us not to use any Java script to
set the cursor to default position.
If the client wants the curosr set to the default position then isn't
JavaScript the only way to do this?

No.
Are you going to keep it a secret? Please share.

Peter

Oct 26 '06 #5
Evertjan. wrote:
<body
onload="document.forms['login'].elements['userrname'].focus();">
Or if you want to be hard-core and robust... ;)

<script type="text/javascript">
window.onload = function() {
var f,lf,u,t;
if ((f=document.forms)
&& (lf=f.login)
&& (u=lf.elements.username)
&& (t=u.type)
&& ("text"==t)
&& (u.value==u.defaultValue)
) {
u.focus();
}
}
</script>

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Oct 26 '06 #6
Peter Michaux said the following on 10/25/2006 9:51 PM:
Randy Webb wrote:
>Peter Michaux said the following on 10/25/2006 6:53 PM:
>>GS wrote:
we are using the following script for cursor to goto default position,
is this script is java script or not?. can somebody tell me. I got this
script from Internet, our client told us not to use any Java script to
set the cursor to default position.
If the client wants the curosr set to the default position then isn't
JavaScript the only way to do this?
No.

Are you going to keep it a secret? Please share.
Look into HTML and tabindex

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 26 '06 #7
Matt Kruse wrote on 26 okt 2006 in comp.lang.javascript:
Evertjan. wrote:
><body
onload="document.forms['login'].elements['userrname'].focus();">

Or if you want to be hard-core and robust... ;)

<script type="text/javascript">
window.onload = function() {
var f,lf,u,t;
if ((f=document.forms)
&& (lf=f.login)
&& (u=lf.elements.username)
&& (t=u.type)
&& ("text"==t)
&& (u.value==u.defaultValue)
) {
u.focus();
}
}
</script>
Wow, U.topValue, U in element, U in form now(), Mat.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 26 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andy R. | last post by:
Hello everyone, I've spent quite some time now, looking for some information on how to get this done, sadly none has helped me much, though. I have a bit of java scrpt on a webpage (.php) to...
4
by: lawrence | last post by:
I want to offer my friends a ping service, where certain of their pages will be called once a week. My impression is that no PHP script can be made to run very long. Assuming a situation where I...
4
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble...
2
by: enclume42 | last post by:
Hello, I am a pure Linux guy. I wrote a Java program that is going to be used by some Windows people, and I wish the startup of the program to be as simple as possible, namely to double-click on...
0
by: Mircea Pleteriu | last post by:
Hi all, I have created a .NET Windows control with c#. I have placed the control on a HTML page within the OBJECT element. Everything works fine up to now. Now, I wanna implement the...
4
by: Don Grover | last post by:
I hope some one can help, I have a html table that is created with asp that has a row of repeated buttons down the side. these call a page passing a query string with invoice number. I need to...
4
by: Jeff | last post by:
Hi, Are there anyone can help me? My questions are as following: Because I have a tools bar which coding with javascript, it will reuse very often. So I want to separate the client-side java...
9
by: Mickey Segal | last post by:
The long-simmering Eolas patent dispute: http://www.microsoft.com/presspass/press/2003/oct03/10-06EOLASPR.mspx has led to an optional Microsoft Update: http://support.microsoft.com/kb/912945/en-us...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
0
by: tosreejithp | last post by:
Hi, My first problem was i am not able to compiled a file from java script to java class.Now its clear and working fine..now i can convert a java script file to java class by Rhino Java Script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.