Java Script textbox properties!!

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"

      ELSE
           FORM1.txtInspectorName.value = BioPlugInActX.Result
      end if
      End Sub
</script>

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.
phil301Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rbadaroCommented:
Hi.

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.
0
wtconwayCommented:
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.
0
phil301Author Commented:
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.
0
wtconwayCommented:
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 http://msdn.microsoft.com/library/default.asp?url=/workshop/author/html/reference/elements.asp 

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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.