locked
TextBox Control RRS feed

  • Question

  • User-1240079221 posted
    How do you Set the Focus of a TextBox control since there is no set tab order? I want my Form to open with the cursor active in a textbox. Thanks for the Help.
    Friday, April 4, 2003 2:14 PM

All replies

  • User-1554502080 posted
    You would need to write custom code in the script template <mobile:DeviceSpecific id="DeviceSpecific1" runat="server"> <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template"> <scriptTemplate> <script language="javascript" for="window" EVENT="onload()"> document.Form1.TextBox2.focus(); </script> </ScriptTemplate> </Choice> </mobile:DeviceSpecific> thanks AndreSS
    Friday, April 11, 2003 7:50 PM
  • User1932625475 posted
    I have seen several times the above posting as solution for the PPC barcode scanner issue, where you need the focus of the page set on page load. What do I do wrong ? Please help. Any hint will be highly appreciated ! Well, It doesnt work for me, and i dont get the bug in my simple test page: <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <%@ Page Language="vb" AutoEventWireup="false" Codebehind="MWnyatecSCANInput.aspx.vb" Inherits="NyatecSCANInput.MWnyatecSCANInput" %> <HEAD> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/Mobile/Page"> </HEAD> <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm"> <mobile:Form id="nyatec" runat="server"> <mobile:DeviceSpecific id="DeviceSpecific1" runat="server"> <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template"> <scriptTemplate> <script language="javascript" for="window" EVENT="onload()"> document.Form1.TextBox1.focus(); </script> </ScriptTemplate> </Choice> </mobile:DeviceSpecific> <mobile:TextBox id="TextBox1" runat="server"></mobile:TextBox> </mobile:Form>
    Thursday, July 1, 2004 10:33 AM
  • User2085740027 posted
    HI, I have tested your code it seams that u have not set the proper form name to the script. Pls check this code... <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm"> <mobile:Form id="nyatec" runat="server"> <mobile:DeviceSpecific id="DeviceSpecific1" runat="server"> <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template"> <scriptTemplate> <script language="javascript" for="window" EVENT="onload()"> document.nyatec.TextBox1.focus(); </script> </ScriptTemplate> </Choice> </mobile:DeviceSpecific> <mobile:TextBox id="TextBox1" runat="server"></mobile:TextBox> </mobile:Form>
    Friday, July 2, 2004 9:46 AM
  • User1932625475 posted
    Hi, thx for your fast reply. I have tested your idea, but still get same error: [ArgumentException: Auf der Seite "isHTML32", die System.Boolean zurückgibt und System.Web.Mobile.MobileCapabilities und System.String als Argumente akzeptiert, ist weder eine Gerätefunktion mit dem Namen "isHTML32" noch eine öffentliche, nicht statische Methode vorhanden.] System.Web.UI.MobileControls.DeviceSpecificChoice.Evaluate(MobileCapabilities capabilities) System.Web.UI.MobileControls.DeviceSpecific.get_SelectedChoice() System.Web.UI.MobileControls.DeviceSpecific.ApplyProperties() System.Web.UI.MobileControls.MobileControl.ApplyDeviceSpecifics() System.Web.UI.MobileControls.MobileControl.OnInit(EventArgs e) System.Web.UI.MobileControls.Panel.OnInit(EventArgs e) System.Web.UI.MobileControls.Form.OnInit(EventArgs e) System.Web.UI.Control.InitRecursive(Control namingContainer) +241 System.Web.UI.Control.InitRecursive(Control namingContainer) +179 System.Web.UI.Page.ProcessRequestMain() +174 My own research seems to reveal, that I missed something while pasting the device filter in, as I have no infos in my web.config : <deviceFilters> </deviceFilters> Could you provide me a sample, on how this part of the web.config must be set correctly ? I did´t get any usefull hint or EXAMPLE from the documentation so far. Many thx in advance !
    Monday, July 5, 2004 4:36 AM
  • User-1404012336 posted
    <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <deviceFilters> <filter name="isHTML32" compare="PreferredRenderingType" argument="html32" /> </deviceFilters> </system.web> </configuration>
    Tuesday, July 6, 2004 5:47 PM
  • User746022867 posted

    Even i am also facing the same trouble

    I have modified my web.config file also

    <deviceFilters>

    <filter name="isJPhone" compare="Type" argument="J-Phone"/>

    <filter name="isHTML32" compare="PreferredRenderingType" argument="html32"/>

    <filter name="isWML11" compare="PreferredRenderingType" argument="wml11"/>

    <filter name="isCHTML10" compare="PreferredRenderingType" argument="chtml10"/>

    <filter name="isGoAmerica" compare="Browser" argument="Go.Web"/>

    <filter name="isMME" compare="Browser" argument="Microsoft Mobile Explorer"/>

    <filter name="isMyPalm" compare="Browser" argument="MyPalm"/>

    <filter name="isPocketIE" compare="Browser" argument="Pocket IE"/>

    <filter name="isUP3x" compare="Type" argument="Phone.com 3.x Browser"/>

    <filter name="isUP4x" compare="Type" argument="Phone.com 4.x Browser"/>

    <filter name="isEricssonR380" compare="Type" argument="Ericsson R380"/>

    <filter name="isNokia7110" compare="Type" argument="Nokia 7110"/>

    <filter name="prefersGIF" compare="PreferredImageMIME" argument="image/gif"/>

    <filter name="prefersWBMP" compare="PreferredImageMIME" argument="image/vnd.wap.wbmp"/>

    <filter name="supportsColor" compare="IsColor" argument="true"/>

    <filter name="supportsCookies" compare="Cookies" argument="true"/>

    <filter name="supportsJavaScript" compare="Javascript" argument="true"/>

    <filter name="supportsVoiceCalls" compare="CanInitiateVoiceCall" argument="true"/>

    </deviceFilters>

    still i am getting the same error can you help me out.??

    Thursday, July 26, 2007 2:50 AM