Barcode Scanner

Discussion in 'ASP General' started by Rajani, Sep 30, 2004.

  1. Rajani

    Rajani Guest

    I have tickets printed with barcode. When i scan that code is placed in a
    text box of my form. How can i read from the scanner and put it in a specific
    text box?

    Or i directly want to insert into database. This is my actual requirement.

    I tried at many sites. I didnt get reply. I am expecting the answer here.

    Thanx in advance
     
    Rajani, Sep 30, 2004
    #1
    1. Advertisements

  2. Rajani

    Evertjan. Guest

    =?Utf-8?B?UmFqYW5p?= wrote on 30 sep 2004 in
    microsoft.public.inetserver.asp.general:
    This is no website, but a usenet group, so you could be in luck.

    1 Do you want to do this on a client
    2 that runs under windows [what?XP?]
    3 [browser/wscript?}
    4 connected to the server?
    5 [via internet/lan?]
    6 and the server runs asp?
    7 what/where is the output of your barcode reader?

    The ASP part is on topic here.
     
    Evertjan., Sep 30, 2004
    #2
    1. Advertisements

  3. Rajani

    Jeff Cochran Guest

    You can't do that with ASP classic, it's handled client-side. As long
    as the focus is on the text input when scanned, it drops into the
    field automatically. You'd need a Submit button or to use a
    client-side submit process, such as Javascript or ActiveX input to
    send it to the server for processing into the database.

    Check client-side groups for setting the focus on a form.

    Jeff
     
    Jeff Cochran, Sep 30, 2004
    #3
  4. Rajani

    dlbjr Guest

    <html>
    <head>
    <title>BARCODE SCAN</title>
    </head>
    <body onload="form1.barcode.focus();">
    <form action="myself.asp" method="post" name="form1">
    <input type="text" id="barcode" name="barcode"
    size="15" maxlength="15" onchange="submit();">
    </form>
    </body>
    </html>

    'dlbjr
    'Pleading sagacious indoctrination!
     
    dlbjr, Sep 30, 2004
    #4
  5. Rajani

    Rajani Guest

    Hello,

    Thak you all for replying. Yes, i want to run it in intranet site using
    ASP. Yea, once it is scanned, i want to split into different parts(job,
    empid, operation_no)
    and placed in the corr form fields. Then i click submit button to insert
    into database.
    Here, i want to save time for data entry. Means, i dont want to click submit
    button for every code scanned. After i scan all the codes then i click
    submit. How can i generate form which is filled with scanned barcode. Like
    grid.

    Thanx again
     
    Rajani, Oct 1, 2004
    #5
  6. Rajani

    dlbjr Guest

    <html>
    <head>
    <script language="javascript">
    var strlist = "";

    function addBarcode(){
    if(strlist.length > 1){
    strlist = strlist + ",";
    }
    strlist = strlist + form1.barcode.value;
    form1.barcode.value = "";
    list.innerHTML = strlist;
    }

    function kH(e) {
    var pK = document.all? window.event.keyCode:e.which;
    if(pK != 13){
    return pK != 13;
    }
    else{
    addBarcode();
    setFocus();
    return pK != 13;
    }
    }
    document.onkeypress = kH;
    if (document.layers) document.captureEvents(Event.KEYPRESS);

    function setFocus(){
    form1.barcode.focus();
    }
    </script>
    <title>BARCODE SCAN</title>
    </head>
    <body onload="setFocus();">
    <form action="" method="post" name="form1" id="Form1">
    <input type="text" id="barcode" name="barcode"
    size="15" maxlength="15" onchange="addBarcode();" onblur="setFocus();">
    <input type="submit" value="Submit">
    <input type="hidden" id="bclist" name="bclist"value="">
    <div id="list" width="400"></div>
    </form>
    </body>
    </html>
     
    dlbjr, Oct 1, 2004
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.