onchange not working

i have 2 textboxes,

I enter some text into first textbox and when i finish, the second textbox value is given the first textboxes values. e.g it gets copied cover to second textbox.

what i cant get working is when the second textbox gets a value i want to fire an onchange event on the second textbox but i t never fires.

<input type="text" onblur="document.myform.theDate.value=this.value">

<input type="text" value="" name="theDate" onchange="date=this.value;updateDate('date');">

what am i doing wrong?
LVL 16
ellandrdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LakioCommented:
can you give me the updateDate() code or just a whole page

date is a var so dont have ' '

<input type="text" value="" name="theDate" onchange="date=this.value;updateDate(date);">

or just

<input type="text" value="" name="theDate" onchange="updateDate(this.value);">
0
bubbledragonCommented:
The onchange event does not fire when the object is changed programatically.
0
LakioCommented:
why not do it like this?
<input type="text" onblur="document.myform.theDate.value=this.value;updateDate(this.value)">

<input type="text" value="" name="theDate" onchange="updateDate(this.value);">
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ZvonkoSystems architectCommented:
Check also this:

<input type="text" onblur="dF=this.form.theDate;dF.value=this.value;dF.onchange()">

<input type="text" value="" name="theDate" onchange="date=this.value;updateDate('date');">

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LakioCommented:
hehe I did not think of that :P
this.form.theDate
0
ellandrdAuthor Commented:
what is dF?
0
ZvonkoSystems architectCommented:
dF is a var defined by assigning this.form.theDate input field reference.
0
ellandrdAuthor Commented:
sorry im not with you?

so do i just create new var called dF?
0
ellandrdAuthor Commented:
like your code works but i dont understand this dF var... im just ttying to understand what you did and maybe learn something new...
0
ZvonkoSystems architectCommented:
"so do i just create new var called dF?"
Yeap!

This version is only a short form:
<input type="text" onblur="dF=this.form.theDate;dF.value=this.value;dF.onchange()">

Of this:
<input type="text" onblur="this.form.theDate.value=this.value;this.form.theDate.onchange()">



0
LakioCommented:
and this is the long one:
<input type="text" onblur="document.myform.theDate.value=this.value;document.myform.theDate.theDate.onchange()">
0
LakioCommented:
<input type="text" onblur="document.myform.theDate.value=this.value;document.myform.theDate.onchange()"> *
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.