473,399 Members | 3,603 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.

whats wrong with this java script?

Hi I have some code and java script, when the page initially loads I want it
to have focus on dr_tx_names. This works. The page loads a second time with
a dropdown selection and in the code behind I have
Me.dr_lst_systype.Attributes.Add("onFocus", "javascript:DoHighlight()")
as I want the focus to go to dropdown box dr_lst_systype when the page
reloads after a selection is made from dr_lst_systype. Anyhow it seems
everytime the page reloads the dr_tx_names receives focus.

<form id="Form1" method="post" runat="server">
<script language="javascript" event="onload" for="window">
Form1.dr_tx_names.focus();
</script>
<script language="javascript">
function DoHighlight()
{document.Form1.dr_lst_system.select();}</script>
--
Thanks.
Paul G
Software engineer.
Nov 19 '05 #1
2 1195
The dropdown doesn't have focus when the page reloads. Your onload for the
window runs, and puts focus in the textbox. So the onFocus for the dropdown
can't run, because the dropdown is not the one with the focus.

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hi I have some code and java script, when the page initially loads I want
it
to have focus on dr_tx_names. This works. The page loads a second time
with
a dropdown selection and in the code behind I have
Me.dr_lst_systype.Attributes.Add("onFocus", "javascript:DoHighlight()")
as I want the focus to go to dropdown box dr_lst_systype when the page
reloads after a selection is made from dr_lst_systype. Anyhow it seems
everytime the page reloads the dr_tx_names receives focus.

<form id="Form1" method="post" runat="server">
<script language="javascript" event="onload" for="window">
Form1.dr_tx_names.focus();
</script>
<script language="javascript">
function DoHighlight()
{document.Form1.dr_lst_system.select();}</script>
--
Thanks.
Paul G
Software engineer.

Nov 19 '05 #2
Hi thanks for the response. I formatted out the onload event javascript but
it still does not go to the dropdown.

<script language="javascript" event="onload" for="window">
//Form1.dr_tx_names.focus();</script>
<script language="javascript">
function DoHighlight()
{
document.Form1.dr_lst_system.select();
}
</script>--
Paul G
Software engineer.
"Marina" wrote:
The dropdown doesn't have focus when the page reloads. Your onload for the
window runs, and puts focus in the textbox. So the onFocus for the dropdown
can't run, because the dropdown is not the one with the focus.

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hi I have some code and java script, when the page initially loads I want
it
to have focus on dr_tx_names. This works. The page loads a second time
with
a dropdown selection and in the code behind I have
Me.dr_lst_systype.Attributes.Add("onFocus", "javascript:DoHighlight()")
as I want the focus to go to dropdown box dr_lst_systype when the page
reloads after a selection is made from dr_lst_systype. Anyhow it seems
everytime the page reloads the dr_tx_names receives focus.

<form id="Form1" method="post" runat="server">
<script language="javascript" event="onload" for="window">
Form1.dr_tx_names.focus();
</script>
<script language="javascript">
function DoHighlight()
{document.Form1.dr_lst_system.select();}</script>
--
Thanks.
Paul G
Software engineer.


Nov 19 '05 #3

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

Similar topics

9
by: iz0nlee | last post by:
can anybody tell me what is wrong here, I got this shockwave test from javascript in easy steps but it doesnt open the pages required <html> <head> <script type = "text/javascript"> if ( ...
176
by: basecamp | last post by:
just checking the average age of programmers using this group -- thanks
3
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."',...
62
by: TheShadow1 | last post by:
safetyTips - this array is in here.js ...
2
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40)....
1
by: Varun Gupta | last post by:
PATH="/clocal/mqbrkrs/user/mqsiadm/sanjay/" MAIL_RECIPIENTS="rb903@dcx.com" Subject="File accessed in last minutes:" find "$PATH" -type f -amin -1 > temp.txt.$$ cat temp.txt.$$ | \ while read...
1
by: linksterman | last post by:
I am making this pretty basic chat project, and I found this echo server on the internet and decided to modify it my needs (much of the methods and fields are the same). Basically what my program...
1
thatos
by: thatos | last post by:
When I run this program import au.id.jericho.lib.html.*; import java.util.*; import java.io.*; import java.net.*; public class DisplayAllElements { public static void main(String args)...
6
by: Silentshot232 | last post by:
Ok It seems to be effecting both my laptop and my desk top I cant sign onto aim I cant get on google page and It only lets me watch 1/4 of the youtube videos I want to. I have all the recent Java and...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.