473,480 Members | 5,041 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

windows mobile how to set focus in textbox

20 New Member
Hi all
i am trying to set focus in textbox. Its a System.Web.UI page. and textbox is System.Web.UI.WebControls
so using setfocus works fine in desktop window but setfocus doesnt work in windows mobile.

any work around this problem.
i hope i have made my statement clear
i saw other thread too but that seems to be dead

Thanks
Jun 28 '09 #1
2 4379
Plater
7,872 Recognized Expert Expert
Web applications require that you use javascript to give a control focus.
You can use the document.getElementById(idstring) to grab the control you are after and then use .focus().
Stick that snipit in the javscript's load event for the body element.


Edit, I made this helper function you can use.
Expand|Select|Wrap|Line Numbers
  1. function focusById(idstring)
  2. {
  3.     var o=document.getElementById(idstring);
  4.     if(o!=undefined)
  5.     {
  6.         o.focus();
  7.     }
  8. }
  9.  
Jun 30 '09 #2
zahid313
20 New Member
thanks for your reply
i will try your solution and let you know if it works in mobile environment
Jul 2 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4622
by: Jose Gonzalez | last post by:
How to apply a numeric format to a textbox using xhtml? I know you have to use the "-wap-input-format" style tag in css. I can get this to work in a regular xhtml page, however, I've been...
2
7492
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
0
1755
by: Wiktor Zychla | last post by:
Hi there, I've just started to dig into mobile ASP.NET and I'd really wish to clarify few things. I have the experience with ASP.NET. 1) Some tutorials mention something called Microsoft...
5
8696
by: Tosch | last post by:
I have a usercontrol with a label, a textbox, a treeview, a grid and a couple of checkboxes. The usercontrol is hosted on a form together with a cancel and a accept button. This form is used to...
7
2713
by: Justin Hoffman | last post by:
I am new to vb.net programming and am just exploring the way databinding works with Windows forms and am having trouble with some fairly basic customization of data entry. The form uses the...
3
4903
by: hugo | last post by:
Hi, I have a function that I call from form fields using the OnKeyUp function to replace special caracters. Once this function has been called, it does not set the focus on the form field where...
1
3660
by: OldYgg | last post by:
Hello Everyone, and thanks for any help if you are able to do so. I'm an experience programmer with web development and I've developed code through ASP, ASP.NET, VB.NET VB, ABAP, SQL, etc. I'm...
1
2475
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
Hi. I have Mobile site that I'm building. My problem is that all of my pages are built as Mobile ASPX pages, but occasionally, I need to use controls which are not mobile. Most specifically, the...
1
2592
by: Duncan | last post by:
Hi all, I'm tearing my hair out on this! I have a simple ASP.NET 2 page with a TextBox control, in the PreRender I set ClientSide events:- Response.Attributes.Add("onchange",...
0
7041
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
7080
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
6908
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
5331
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,...
1
4772
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...
0
4478
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...
0
2994
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...
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.