Advertisement

07.09.2008 at 08:11AM PDT, ID: 23550567
[x]
Attachment Details

asp, Windows CE, setting focus to a text box on load and reload

Asked by Chuck_aa in Active Server Pages (ASP), FrontPage-Expressions

Tags: asp, Windows CE, setting focus on a

I'm using Classic ASP on a Windows 2000 server to direct a handheld running Wiindows CE to input a barcode scan to SQL. My problem is that I can't set focus to the input textbox on the hand held scanner. My code below is using a java script to reset focus and it works on my desktop IE 6 and 7 however it dosn't work for the hand held.

Chuck

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Scan Bags</title>
<!-- #Include Virtual = "ASPMaster.asp" -->
<!-- #Include Virtual = "CityMaster.asp" -->
<% Step = Request.QueryString("Step") %>
<% If Step = "" Then Step = "Scan" %>
<% M = Request.QueryString("M") %>
<SCRIPT LANGUAGE="JavaScript">

<!--
Begin
 function putFocus(formInst, elementInst) {
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
 }
 
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'
// DON'T FORGET TO LOOK AT THE BODY TAG FOR THE KEY TO THIS SCRIPT
  End
-->


</script>
<style>
<!--
div.Section1
      {page:Section1;}
-->
</style>

</head>
<BODY onload="PutFocus(0,0);" topmargin="0" leftmargin="0" >



<%

If Step = "Scan" Then %>
<% If Request.Form("ScanLocation") <> "" Then %>
<% Session("ScanLocation") = Request.Form("ScanLocation") %>
<% End If %>
<% 'If Session("ScanLocation") = "" Then Session("ScanLocation") = Session("ScanLocation") %>
<form  method="POST" action="Scan.asp?City=<% = Session("City") %>&Step=Insert" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" >
<table>
<tr>
<td align=left colspan="2" style="border: 1 solid #000000"><b><font face="Verdana" size="3">Scan Bags</font></b></td>
</tr>
<tr>
<td align=left colspan="2"><% = session("city") %>/<% = Session("ScanLocation") %></td>
</tr>
<tr>
<td align=left><font size="1" face="Trebuchet MS">Scan Bag Or<br>
Manually Input<br>
 10-Digit Tag Number</font></td>
      <td>
      &nbsp;<!--webbot bot="Validation" s-display-name="FullTag" s-data-type="Integer" s-number-separators="x" b-value-required="TRUE" i-minimum-length="10" i-maximum-length="10" --><INPUT  type=text name=BagTag size=10 maxlength=10 stiscan="ABCDEFGHIJKL" stisubmit tabindex=0 class="Section1" id="0" ></td>
</tr>
<% If M = "Accepted" Then %>
<tr>
<td align=left colspan="2" bgcolor="#000000"><b><font color="#FFFFFF" face="Verdana">Scan Accepted!</font></b></td>
</tr>
<% End If %>
</table>

<table>
</form>
<% End If %>
<% If Step = "Insert" Then %>
<% FullTag = Request.Form("BagTag") %>
<% If Session("City") = "" Then Response.Redirect "http://rovingagent.aa.com" %>
<% If FullTag = "" Then Response.Redirect "http://rovingagent.aa.com" %>
<% If Session("ScanLocation") = "" Then Response.Redirect "http://rovingagent.aa.com" %>
<%      Dim Obj
      Dim RS
      Dim CM
      Dim CN
      Set CN = Server.CreateObject("ADODB.Connection")
      Set CM = Server.CreateObject("ADODB.Command")
      Set RS = Server.CreateObject("ADODB.RecordSet")

      strSQL = "sp_insert_tblscan_manual"
      CN.Open Application("CITY_TODAY")
      CM.ActiveConnection = CN
      CM.CommandText = strSQL
      CM.CommandType = adCmdStoredProc
      CM.Parameters.Append CM.CreateParameter("City", adVarChar, adParamInput, 3, UCASE(Session("City")))
      CM.Parameters.Append CM.CreateParameter("FullTag", adVarChar, adParamInput, 10, FullTag)
      CM.Parameters.Append CM.CreateParameter("Location", adVarChar, adParamInput, 10, Session("ScanLocation"))
      CM.Execute

            Response.Redirect "http://0.0.0.0/scan/scan.asp?Step=Scan&M=Accepted"

%>
<% End If %>
<td><b><font face="MS Sans Serif" size="3">Also</font></b>
<p><a href="http://0.0.0.00/index.asp?City=<% = Session("City") %>"><font face="MS Sans Serif" size="2">Home</font></a><font face="MS Sans Serif" size="2">
|<a href="Location.asp?City=<% = Session("City") %>&amp;SC=None">Change Scan Location</a></font></p>
<td>
</table>
</body>












Start Free Trial
[+][-]07.09.2008 at 10:37AM PDT, ID: 21966211

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 10:38AM PDT, ID: 21966220

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 08:54AM PDT, ID: 21974669

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 09:19AM PDT, ID: 21974962

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 09:22AM PDT, ID: 21974992

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 10:00AM PDT, ID: 21975435

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 03:01PM PDT, ID: 21977764

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 07:55AM PDT, ID: 22016542

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 07:57AM PDT, ID: 22016561

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:33AM PDT, ID: 22023650

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:15PM PDT, ID: 22030425

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), FrontPage-Expressions
Tags: asp, Windows CE, setting focus on a
Sign Up Now!
Solution Provided By: brundo
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628