Java Script textbox properties!!

Posted on 2006-03-29
Last Modified: 2012-06-21
I am attempting to write a page that uses an encrypted finger print reader for secure access. I am using the following JavaScript to read in the value:

 <input type = "Button"  name="FINGER" value="SIGN IN" id="Button1"  language = "javascript" onclick="return Button1_onclick()"  />

script language="vbScript">

      // Identify using two fingers, three scans each
      Sub FINGER_OnClick
            BioPlugInActX.IdentifyQuick "0"
      End Sub

      Sub BioPlugInActX_OnIdentify
      If BioPlugInActX.Result = 000000000 then
      Form1.txtID.value = "ID NOT FOUND"
      BioPlugInActX.IdentifyQuick "0"

      ELSEIF BioPlugInActX.Result = "BADSCAN" then
         Form1.txtID.value = "BAD SCAN, RETRY!"
         BioPlugInActX.IdentifyQuick "0"

      ElseIF BioplugInActX.Result = -1 then
         Form1.txtID.value = "BAD SCAN RETRY!"
      BioPlugInActX.IdentifyQuick "0"

           FORM1.txtInspectorName.value = BioPlugInActX.Result
      end if
      End Sub

The value from the reader is passed to the textbox fine. The problem I have, is if I make the textbox secure by using "readonly", ASP just sees the value as an empty string, even though I can see it written in the textbox. If I unsecure the box, then asp passes the value.

How can I secure the textbox and still have the value passed. Thanks.
Question by:phil301
    LVL 2

    Expert Comment


    One solution would be to set the readonly property to trye before setting the value and setting it to false after setting the textbox value. In your case, put the code at the begining and end of the BioPlugInActX_OnIdentify Sub.
    LVL 7

    Expert Comment

    If modifying the readonly to true doesn't quite help the situation you could always try shifting the focus to another control once the textbox receives focus. For example:

    <asp:TextBox ID="txtID" Runat="Server" OnFocus="FINGER.focus()"/>

    the OnFocus handler will run at the client side and shift the focus to another control. No clue if VBScript will force focus on the object to modify it's value, but you could try it.

    Author Comment

    Thanks for the reply. I am new to JavaScript, can you explain your code (<asp:TextBox ID="txtID" Runat="Server" OnFocus="FINGER.focus()"/>) a little further. I understand the concept of what you are saying, just not the Java. Is FINGER.focus a textbox in my form? Do I have to write code in the handler? I simply inserted the OnFocus=CollarSn() into my form, and it did nothing.

    Thanks in advance.
    LVL 7

    Accepted Solution

    No problem. FINGER is the name of the button you had listed in your code in your first post. So if you give the button or textfield or dropdownlist or any input object a name you can use the focus() method to switch input to that control. The best site to visit to learn more about what methods and properties are available in javascript is

    You'll find loads of information on each HTML tag. The onFocus handler basically says, once the cursor is in the textbox, move the cursor to the button named FINGER. But you can do all kinds of stuff with JavaScript, to play around with it, see what works out best.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now