I was using asp textbox, but somehow it can not be focused in apple devices, so I tried input tag in html, it worked. But now I need to pass the value to the back(vb script) I tried request.form/request.querystring, none of them worked.

This is the code passed value to vb, but can not be focused: ASPX:

<asp:TextBox ID="txtUserID" runat="server" AutoPostBack="false" Height="100"        Font´╝ŹSize="50"/>
<a href="javascript: PressEnterViaNextButton();"/>

JS:

document.getElementById("txtUserID").focus();

VB:

Private Sub txtUserID_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtUserID.TextChanged
        Session("UserID") = txtUserID.Text
    End Sub

This is the code can be focused but, I don't know how to pass the value.

ASPX:

<input runat="server" id="txtUserID" name="txtUserID1" type="text" class="input"  onchange="getValue(this.value)" value="1"/>
                    <a href="javascript: PressEnterViaNextButton();"/>

JS:

document.addEventListener('DOMContentLoaded', function () {
                            var button = document.querySelector('#fbtn');
                            var input = document.querySelector('#txtUserID');
                            var focus = function (e) {
                                e.stopPropagation();
                                e.preventDefault();
                                var clone = input.cloneNode(true);
                                var parent = input.parentElement;
                                parent.appendChild(clone);
                                parent.replaceChild(clone, input);  
                                input = clone;
                                window.setTimeout(function () {
                                    input.value = input.value || "";
                                    input.focus();
                                }, 0);
                            }
                            document.addEventListener('mousedown', focus);
                            document.addEventListener('touchstart', focus);

                        }, false);

VB:

Dim userid As String = Request.Form("txtUserID")

Related posts

Recent Viewed