Comment on Tutorial - Click to remove an element from a select html form using javascript By Emiley J.



Comment Added by : Tom Theriault

Comment Added at : 2010-12-14 14:54:09

Comment on Tutorial : Click to remove an element from a select html form using javascript By Emiley J.
Hi,

I am new to html, and javascript.

I've built a form, with one field with a click of a character A-Z and/or 0-9 will passit to my field in my form.

I am using a simple javascirpt passit function.

I am also wanting to delete the last character.

But I can not find a simple function that will allow me to delete the last character as I click on a character I would like to click and delete just as easily.

Here is my passit function:

function passit(str)
{document.plate.plateinput.value+=str}

I copied the same function and changed the name and used a minus instead of a plus in front of the equal sign but it didn't work:

function clearit(str)
{document.plate.plateinput.value-=str}

Can you help me here.

I've assigne this " <- " on my form to the javascript "clearit" so every time I click on " <- " I want to delete the last character in my field.

Thank you.

Tom :-)

Snozzle's Car Washes
410.456.0177


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Thanks for the above description, but pls let me k
View Tutorial          By: Amit Goyal at 2009-09-25 05:33:10

2. Very concise, but it would be more helpful without
View Tutorial          By: Randy at 2010-11-17 14:16:01

3. Please note that the above code does not work with
View Tutorial          By: mk at 2012-02-15 10:59:49

4. You are using "this" to start to the thr
View Tutorial          By: sumit at 2014-10-30 08:14:55

5. Hii I m Ravi. This is a good example.
Here

View Tutorial          By: Ravi at 2011-02-17 09:09:06

6. hi,
while exporting data i am getting error

View Tutorial          By: akash at 2011-12-22 07:28:05

7. you're so great!
View Tutorial          By: renz at 2008-08-10 18:29:59

8. its really a good post... very informative..
View Tutorial          By: javagava at 2011-12-13 19:49:08

9. hai, i tried the abvoe code, m getting the follwin
View Tutorial          By: charan at 2011-10-20 12:59:59

10. Excelent sample, I'm disagree with Anon, the sampl
View Tutorial          By: Gerardo Saldívar at 2009-09-21 15:25:01