Kindle Silk Browser: Set focus on a textbox

119 views Asked by At

This is my first post, so I hope it finds it's way to the correct forum.

I created a web page with a SQL backend to capture the start time for a production job. There is only one textbox on the page. After the timestamp is saved, the focus is directed back to the textbox so that the next timestamp can be entered. It works fine for the browsers on my PC..I've tested it in IE and Chrome both.

However, the end user will be using a Kindle Fire HD tablet to input data. The form displays properly on Kindle's Silk Browser, but the focus doesn't set on my textbox. I have to use my finger to press inside the textbox in order for the cursor to appear.

I wrote code in both C# and JS to set the focus on my textbox, but neither approach worked on the Silk Browser. Again, it works fine on my PC for IE and Chrome.

I mostly work with SQL and I'm just starting to branch out into .net and C#. If someone could point me in the right direction, I would certainly appreciate it. Thanks!

void btnSave_Click(object sender, EventArgs e) {
cmd = new SqlCommand("UpdateEndTime_sp", con); 
cmd.CommandType = CommandType.StoredProcedure; 
cmd.Parameters.Add("@WorkOrderNum", SqlDbType.Int).Value = tbWorkOrderNum.Text; con.Open(); 
cmd.ExecuteNonQuery(); 
con.Close(); 
tbWorkOrderNum.Text = ""; 
Label1.Visible = true; 
tbWorkOrderNum.Focus(); 

Javascript:

if (document.getElementById("Textbox1").value == "") { 
  document.getElementById("Textbox1").focus(); 
} 
0

There are 0 answers