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 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2010
    Location
    Home: Essex, Current Location: Loughborough
    Posts
    21
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question Creating a Backspace Button

    I have created a keyboard on Taco HTML via a table of buttons and within this keyboard I need a functioning Backspace button using javascript. I currently have a 'reset' button which clears all of the values in the text box.

    If anyone could help on the coding for this backspace button it would be greatly appreciated

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,516
    Thanks
    77
    Thanked 4,381 Times in 4,346 Posts
    No idea what a Taco is other than a wonderful food source, but...

    Can't you just do
    Code:
         fld.value = fld.value.substring( 0, fld.value.length-1 );
    ???
    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.

  • Users who have thanked Old Pedant for this post:

    georgesofroniou (12-07-2010)

  • #3
    Regular Coder
    Join Date
    Apr 2010
    Posts
    163
    Thanks
    3
    Thanked 25 Times in 25 Posts
    Code:
    fld.value = fld.value.substring( 0, fld.value.length-2 );

  • Users who have thanked gizmo1650 for this post:

    georgesofroniou (12-07-2010)

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,516
    Thanks
    77
    Thanked 4,381 Times in 4,346 Posts
    ???? - 2 ??? Why? Instead of -1 ???
    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.


  •  

    Tags for this Thread

    Posting Permissions

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