473,394 Members | 2,063 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,394 software developers and data experts.

Disabling the default selection of buttons in a form

Please Help,
I have a form with multiple buttons "New User", "Delete User", "Save"
buttons, when I access the form it selects the "New User" button by default,
so when you hit the return key ("keyboard") it goes directly to "New User"
form.
My question is:
How could I disable the default selection so that when I access the form
none of the buttons is selected until I click on it myself?
Many thanks in advance.
Regards
Lamine
Nov 19 '05 #1
1 1225
Hi Lamine,

you should be able to just put

onload="this.focus()"

in the body tag of your aspx page.
Or if you would like to focus on something else use

document.getElementById('IDofTheControl').focus()

ASP.Net tells you the ID's you controls will get with myControl.ClientID,
that way you could focus on a different button.

Hope this helps
Johannes

"Lamine Darbouche" <la******@mpt-ltd.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP12.phx.gbl...
Please Help,
I have a form with multiple buttons "New User", "Delete User", "Save"
buttons, when I access the form it selects the "New User" button by
default,
so when you hit the return key ("keyboard") it goes directly to "New User"
form.
My question is:
How could I disable the default selection so that when I access the form
none of the buttons is selected until I click on it myself?
Many thanks in advance.
Regards
Lamine

Nov 19 '05 #2

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

Similar topics

8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
15
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
5
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main...
3
by: Mike | last post by:
That is exactly what I am looking for. Just one thing, after I turn the cursor into a wait cursor, is there a way to disable all the controls (e.g buttons, textboxes) so that I can't click on...
5
by: Wonder | last post by:
How can I create or use the msgobx to show a message without a default button. The user has explicity to click on the button, so the msgbox closes it. Thanks,
1
by: mssbass | last post by:
In order to disable the previous and next buttons on my form, I followed the attached code. The buttons seem to work fine except for one thing. When the form first opens, the next button is...
9
by: dozingquinn | last post by:
Hello, I have a combo box on a form that I would like to 'lock' the selection of after the user makes a selection, then either moves to the next record or saves the form. This selection will...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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:
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...

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.