[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

onkeyup and onkeydown for subtexts in a text

Posted on 2004-10-08
2
Medium Priority
?
1,127 Views
Last Modified: 2008-03-06
Ok, the scenario is:

I have a text box.. I want to fire "onkeyup" and "onkeydown" events in that textbox after i enter a space in it !

In detail:

I have to insert WORK_HOURS, PLACE_OF_WORK and DETAILS_OF_WORK in one textbox.(thats called Quick Insert mode of our project). Those 3 should be seperated by space. For example, consider i enter:

8.00 Germany Time manegement project

where,

8.00 --> WORK_HOURS
Germany --> PLACE_OF_WORK
Time manegement project --> DETAILS_OF_WORK.

(Note: I split the strnig in server side with no problem.)

what i want is: after i enter the first space (after "8.00") i need to fire onkeyup and onkeydown events till the next space(before "Time manegement project"). that is, i need to call onkeyup and onkeydown events for "Germany" in my example.

Hope that makes sense.
0
Comment
Question by:ldbkutty
[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
2 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 1600 total points
ID: 12258111
Like this:

<input type=text onKeyUp="w=this.value.split(' ');if(w.length==2&&w[1]=='')this.value+='Germany '">

0
 
LVL 9

Assisted Solution

by:riyasjef
riyasjef earned 400 total points
ID: 12258599
here my script

<input type=text

onKeyUp="this.value=this.value.replace(/(8\.00\s+)$/gi,'$1Germany').replace(/(8\.00\s+Germany\s+)$/gi,'$1Time manegement

project')">

riyasjef
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

649 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