how can i get the onchange function work on hidden text field.

HI,

How to get the value of date  onchange of Hidden text field value
i want to get the value in the text box whenever there is change date  .
 the value is created when the calendr pop up and close. how can i get the onchange function work on hidden text field.


<!-- hidden fields -->
<input type="hidden" id='nStart' name='nStart'>

<input type="hidden" id='nEnd'  name='nEnd'>

<input type="hidden" id='nWork' name='nWork'>

plz find the attached files
expert.php
cal.jpg
cal2.js
prashanth agsoftware engineer Asked:
Who is Participating?
 
Alexandre SimõesManager / Technology SpecialistCommented:
You have to trigger the onchange event yourself after changing the value.
HTML
<input id="myHiddenFiled" type="hidden" onchange="changed()" />

Open in new window

JavaScript
function changed(){
    alert('changed');
}

var hiddenField = document.getElementById('myHiddenFiled');
hiddenField.value = 'new value';
hiddenField.onchange();

Open in new window

0
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.

All Courses

From novice to tech pro — start learning today.