SetFocus on Load

D

Don Schilling

How can I set the focus on a textbox for Pocket PC mobile 2003?
On load I would like focus on text box so a bar code can be scanned without
any keypading.
I'm currently using C# in Visual Studio to create either a mobile or web
app.
I've tried javascript, looked at WML, but no luck.
As a side note, I cant seem to find a definitve answer to what javascript is
supported on Pocket PC.
Because of the device I'm using, a Symbol device using a an ARM Xscale
processor, I havent been able to find a third party browser.
Below is the java script I've tried. tbScan is the textbox I would like to
have focus.
I've spent a good chunk of time searching the web for an answer, but most of
the stuff out there is half baked.
TIA
Don

System.Text.StringBuilder sb = new System.Text.StringBuilder("");

sb.Append("<script language='JavaScript'>");

sb.Append("document.getElementById('" + this.tbScan.ClientID +
"').focus();<");

sb.Append("/");

sb.Append("script>");

if (!IsStartupScriptRegistered("Focus"))

{

this.RegisterStartupScript("Focus", sb.ToString());

}
 
W

William Main

It appears as though JavaScript is not exported to the web page from the aspx
age. I've even hard coded script into the aspx page and no luck, the HTML
page has no script in it. I suspect it has to do with the xml.dtd that is
referenced in the generated HTML page (also not ther is never a <HTML></HTML>
tag pair in the output either).

I've had to resort to using standard ASPX and not the MOBILE ASPX page type.

William main
 
D

Don Schilling

Using aspx rather than mobile wont help in this case. Java script is not
supported on the client, so it dosent matter what server method is used.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top