[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to envoke the BackSpace event in Javascript

Posted on 2006-07-05
7
Medium Priority
?
523 Views
Last Modified: 2012-08-14
I have a texbox in my asp page. When the user enter some non-numerical value, it will pop up a message,

"Please Enter only Numbers".  Along with this message, I want to delete the non-numerical character entered by the user. In VB I use Sendkeys + {BACKSPACE}. When I give this command, it sends a backspace .

I want a similar option in Javascript. Any idea???
0
Comment
Question by:CWS (haripriya)
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 17041594
No. However you can cancel the event or chop the field to value.length-1

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 17041613
0
 
LVL 7

Expert Comment

by:ljubiccica
ID: 17041714
Hey!

Well you probably have some function that checks the data given and then shout out some alert message???

In this case you can do something like this:

<script language="javascript">
function alert(){
alert('Enter the real stuff');
resetData();
}

function resetData(){
document.myinput.reset();
}
</script>

where the input you want clear must have the name you specified in document.myinput.reset();
(in this case you would have <input name="myinput">

Hope this is what you needed...

Ljubiccica
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 17041768
@Ljubiccica - welcome to EE.
A few things:

There is no reset on field level...
Also you cannot access a field via document.fieldName
Please do not confuse people...
0
 
LVL 7

Expert Comment

by:ljubiccica
ID: 17041861
OK, i'm sorry...

i should have asked first where does cyberwebservice want to reset things...

i thought he wants to reset <input type="checkbox"> thing...

Sorry once again

Ljubiccica
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 17042235
That is ok, however the code you proposed is not doing anything on any browsers regardless of what he wanted...
0
 
LVL 16

Author Comment

by:CWS (haripriya)
ID: 17200359
Sorry guys, no time for me to test your suggestions. I was tied up with other projects which doesnot use Javascript. I need some more time.

I just want to add coments to avoid this questions to get abondend.

I will check and get back to you soon.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question