Disabling the default selection of buttons in a form

L

Lamine Darbouche

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
 
J

Johannes Hammersen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top