Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-06-2009
Member
 
Join Date: May 2009
Posts: 55
How to call event javascript onkeyup

Hi,
I am newbie in java world. I want to know how can I call a event javascript onkeyup. I want a basic idea of it. As I am not a advance programmer. I need to prepare something of my project work. For example I am trying to create a event which more likely related to currency converter. But I am confused with the syntax. It will be great if someone paste some examples also. Regards.
Reply With Quote
  #2  
Old 09-06-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: How to call event javascript onkeyup

It is an event which works to define the actions performed while the key on the keyboard is released. Whenever the key in the keyboard is pressed and released the onekeyup is activated immediately. It is not an reserved word. So it is possible to configure your own variable and function. It is an quiet easy event. I posting the basic function which you can edit in your script. The example is :
Code:
 <input type="text" onkeyup="myFunction(this)">
Reply With Quote
  #3  
Old 09-06-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: How to call event javascript onkeyup

The onekeyup event handler runs the specified JavaScript function at the time of key press event. It is runs at once when a use release the key from depressed position. The syntax for one key up is onKeyUp="ExampleText" and the parameter for that is ExampleText JavaScript code or a call to a JavaScript function. I am posting a basic example to give you a general idea about the event.
Sample of a script :
HTML Code:
<html>
<head>
<script type="text/javascript">
function upperCase(x)
{
var y=document.getElementById(x).value;
document.getElementById(x).value=y.toUpperCase();
}
</script>
</head>
<body>

Enter your name: <input type="text"
id="fname" onkeyup="upperCase(this.id)">

</body>
</html> 
Reply With Quote
  #4  
Old 09-06-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: How to call event javascript onkeyup

Normally it is a function which occurs when a user press the key and release it. Setting up specific parameters and functions make you work much easier. The event handler with proper format can preform the action which you want to execute. The sample of script below works for docs, images, links, and text. The properties which onKeyUp event handler uses is type which is used to run the type event, target which is shows the object to which the event is assigned, layerX and layer Y, pageX and page Y and screen X and screen Y is the location of cursor at the time of KeyUP, which is denotes the key released on ASCII values and modifiers is an list of keys hold at the time of event. Refer the below sample script.
HTML Code:
<body>
<form action="" method="POST" id="myForm">
<input type="text" name="myText" onKeyUp="changeVal()">

<script type="text/javascript" language="JavaScript">
s1 = new String(myForm.myText.value)

function changeVal() {
     s1 = "You released a key"
    myForm.myText.value = s1.toUpperCase()
}

</script>
</form>
</body>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to call event javascript onkeyup"
Thread Thread Starter Forum Replies Last Post
using href vs. onclick to call javascript function Kalyug Software Development 6 12-05-2010 10:09 AM
Can I Define and Call my Own Functions in JavaScript? Rob Dizzle Software Development 5 09-02-2010 05:18 AM
How to call Readonly textbox in Javascript Function Aldous Windows Software 3 12-08-2009 11:39 AM
Help me with onChange javascript event for php form Brake Fail Software Development 3 22-07-2009 11:42 PM
Call Javascript function in VB.Net code kaartik Software Development 4 22-01-2009 06:14 PM


All times are GMT +5.5. The time now is 04:26 PM.