How can I set the focus on a particular control in a
webform?
IE: If I have 3 textboxs controls on my webform and I
want to be on the middleone , how can I do it?
I saw that there is a method called focus, that it would
replace the .setfocus method of VB6.
But I don't understand the example.
Does anyone have an example ? 2 2272
Hi Gabriel,
Till now I could not do it in vb.net and I think it will be difficult to
start it up from VB.net
Here is some piece of html/javascript code you can paste in your aspx page,
for me it does work.
\\\
<INPUT tabindex="1" id="fieldid" type="text" size="27">
///
This script has to be exact before the end HTML tag.
(That is the reason I think starting it up from vb will not succeed, because
than you go to the load event, but I did not try that till now).
\\\
<script language="JavaS cript">
fieldid.focus() ;
</script>
</HTML>
///
I hope this helps a little bit?
Cor
* "gabriel Morgulis" <an*******@disc ussions.microso ft.com> scripsit: How can I set the focus on a particular control in a webform?
IE: If I have 3 textboxs controls on my webform and I want to be on the middleone , how can I do it? I saw that there is a method called focus, that it would replace the .setfocus method of VB6. But I don't understand the example. Does anyone have an example ?
Call its 'focus' method, for example in a VBScript or JScript.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nitin |
last post by:
Hi
I have created function to check date and time. at the time of
execution, if date is left empty the function returns the error
message but then the focus goes to next field. Next filed is for time
and there is also a check on that. If time is empty return error
message. Again the explorer returns error message and then shifts the
focus to date field, again error message and focus goes to time and
this story goes on and on, untill...
|
by: Peter Wright |
last post by:
Hi all.
Hopefully this should demonstrate the problem I'm having:
http://flooble.net/~pete/focus-problem-demo/
(I'm testing it in Mozilla only, but I'm not sure if it's actually a
Mozilla-only problem)
I'm capturing the focus and blur events for the document, updating a
|
by: VA |
last post by:
t=document.getElementById('mytable')
is a HTML table with some input fields in its cells
Why doesnt
t.getElementsByTagName('tr').firstChild.focus;
put the focus on that text field? It doesnt give any errors, the focus
just doesnt change.
|
by: Neil Ginsberg |
last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a
form with a subform (in continuous form view). A combo box on the main form
has code in the AfterUpdate event which adds a record to the subform (based
on the value of the combo box) and requeries the subform control. I want the
focus to return to the combo box on the main form when it's done, but I
can't get it to do so if the user enters a value and presses Enter...
|
by: avnrao |
last post by:
Hi,
I am facing a problem with control.focus (javascript). Here is the
description of the issue.
1. I have 2 aspx files. on Aspx1 I have button named NewRow. Clicking on
this, will redirect page to Aspx2 which has a Datagrid. PageLoad of Aspx2
displays the DataGrid with existing data filled in and shows a new row (set
of text boxes) in the Footer Item.
Now, when I set the focus by accessing the first text box in the Footer
| |
by: SJ |
last post by:
Hi all,
I have come across a weird problem when attempting to automatically
set the focus in a vb.net form to a checkbox control...
In my form I have (on a tab page in a tab control) several textboxes
and a checkbox. The behaviour I want from my app is as follows:-
When the textbox (which is prior in tab order to the tab control) has
been filled with a certain length of text by the user, the focus is
|
by: Alex.Svetos |
last post by:
Hello,
I'm trying to get a popup to keep focus when it is re-clicked.
The script below is supposed to produce this exact behaviour,
however it doesn't work, at least on firefox 1.0.7 and moz 1.7.12
(linux kubuntu). It does work with konqueror.
It seems to work with firefox on windows but not with IE (not completly
sure though).
|
by: Dave Booker |
last post by:
I am using a WebBrowser object in my .NET 2.0 application, but it is not
shown to the user. Every time a timer event triggers it to perform a
m_WebBrowser.Navigate() I get that classic IE 'click' and it steals the focus
from the user's current application.
How can I prevent the hidden WebBrowser from stealing focus? (And better
yet can I even suppress that click?_
|
by: Roger |
last post by:
Hi,
I am confused about the differences between this.window.focus(),
window.focus(), and this.focus().
I want to use the calls in a <body onload="..."tag. What are the
differences between these forms that may make one succeed and another
fail? In particular, this.window.focus() fails in Opera 9.10 with an
"object not found", and windows.focus() succeeds in Opera 9.10, Firefox
2.02, and IE 7.
|
by: jp2express |
last post by:
I have several applications that use panels as screens, but I can *not* seem
to set the focus for a Textbox.
Panel1.BringToFront()
Panel1_Textbox.Focus()
' do something with a control on Panel1
Panel2.BringToFront()
Panel2_Textbox.Focus()
' do something with a control on Panel2
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |