[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

mushhead

11/10/2004 1:07:00 AM

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());

}


2 Answers

William Main

11/21/2004 6:55:00 AM

0

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

"Don Schilling" wrote:

> 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());
>
> }
>
>
>

mushhead

11/22/2004 4:34:00 PM

0

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.



"William Main" <wmain@nospam.nospam> wrote in message
news:E1825A6E-6903-4FCB-9BA8-4B52ECEADA0D@microsoft.com...
> 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
>
> "Don Schilling" wrote:
>
> > 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());
> >
> > }
> >
> >
> >