We help IT Professionals succeed at work.
Get Started

Replace input text with constant string using Javascript

londonsaf
londonsaf asked
on
527 Views
Last Modified: 2010-04-21
Hi
I'm trying to create n textbox (input) that will change the user input while typing, without postbacks, and in the same textbox, to a constant string I have hidden on a label, no matter what the user types. Is this possible?
So for instance the user types "Hi, How are you", and while the user types the text, this text gets changed, in the same textbox, to a string I specified on a hidden label. He types 'H', it changes to 'S', he types 'i', it changes to 'Z' or whatever I specified on the label.

Don't ask why, it's a project for a friend who's playing a practical joke on somebody, I don't know the details.

Also, I assumed javascript is probably the way to go but I could be wrong. I'm a ASP.NET C# programmer so if there's an AJAX solution I'll rather go with that.

Thanks for your help in advance.
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2004
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE