Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    178
    Thanks
    138
    Thanked 0 Times in 0 Posts

    Help converting a code from VB to Javascript

    Hello,

    I need your help.

    How can I convert the following code to Javascript:

    Code:
    'SEARCH BY FILE NUMBER IN FILE NUMBER WHEN THE ENTER KEY IS PRESSED
    Private Sub h1_KeyDown(ByVal KeyCode As msforms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = vbKeyReturn Then
    KeyCode = 0
    Call btn_search_Click
    End If
    End Sub
    Thanks for all your help in advance

    J

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    You can't.

    That is *SERVER-SIDE* code. I assume VB.NET in ASP.NET, yes? (Though it could be VB6 in an old fashioned ActiveX DLL, I suppose.)

    In any case, you can't replace server-side code with client-side JavaScript.

    The comment says "Search by file number in file...". You can't search in files in the browser. That has to be done server-side.

    If I'm wrong in my assumptions, then show me more of the page that contains that snippet.

    *****

    EDIT: Yeah, I think I'm definitely right.
    Code:
    msforms.ReturnInteger
    msforms means this is for a NON-web based application, right? Using windows forms? The logic is going to be completely different with browser-based code.
    Last edited by Old Pedant; 10-12-2011 at 11:20 PM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •