locked
Remove text from text box on click RRS feed

  • Question

  • User810354248 posted

    I have a text box in my asp.net+VB=SQL database web.

    bidtxt.text is the textbox name.

    I use barcode scanner to insert the id to serach the data in bidtxt.text

    i wanted to remove the text inside the text box on another search.  I used the below code.

    <asp:TextBox ID="bidtxt" onChange="newobjCompute()" onFocus="this.value=''; return false;" runat="server" Width="300px" ToolTip="Box ID" AutoPostBack="True"></asp:TextBox>

    It works only when i ckick  on any other area in page and again click on text box it gets deleted.

    But i am not using any other option in this page. I want to search with barcode scanner and on another clikc on search the text box should be empty.

    any more idea on this

    Sunday, November 25, 2018 11:47 AM

Answers

  • User283571144 posted

    Hi Baiju EP,

    According to your description, I suggest you could firstly search the barcode scanner library to find out the which method will fired when scan complete.

    Then you could write the logic wiht textbox.text="" to remove the textbox and add value into it.

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 26, 2018 6:58 AM

All replies

  • User-1716253493 posted

    Why not simply set tb.text = "" after search? You can display current id in a label or hiddenfield

    Sunday, November 25, 2018 2:38 PM
  • User-471420332 posted
    use asp.net panel with update panels to hide texboxes base on condition
    Sunday, November 25, 2018 5:02 PM
  • User283571144 posted

    Hi Baiju EP,

    According to your description, I suggest you could firstly search the barcode scanner library to find out the which method will fired when scan complete.

    Then you could write the logic wiht textbox.text="" to remove the textbox and add value into it.

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 26, 2018 6:58 AM