troubleshooting Question

working with the HTML textbox onchange event with JavaScript

Avatar of maqskywalker
maqskywalker asked on
JavaScriptHTML
6 Comments1 Solution167 ViewsLast Modified:
I saw this example
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_onchange2

When you run it, it looks like this. So the textbox has the value Hello.

p1.PNG
Now I type the word World in the textbox and click outside the textbox which fires the onchange event like this.

p2.PNG

Is there a way to store the existing value of the textbox in a hidden field and also store the new text i typed in the textbox in a hidden field also, but separately.

So when I run the above example and then type World.

I want to store the existing value which is "Hello" in a hidden field called HiddenField1
and the new text that I typed in the textbox which is "World" in a hidden field called HiddenField2

What's the best way to do that?
ASKER CERTIFIED SOLUTION
Zakaria Acharki
Analyst Developer
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros