Using the code below I am populating a text field on a submission form which is then used as a Parent Field on a Cascading AutoComplete Virtual field triggered when the Date field changes.
This technically works but I find that the AutoComplete field does not update immediately unless I physically visit the parent field and make a keystroke (say a type space at the end of the value).
How can I force the Cascading AutoComplete field to update immediately?
Thanks!
<script type="text/javaScript">
function concatenate()
{
mydate = document.getElementsByName("InsertRecordDate")[0].value;
document.getElementsByName("InsertRecordDate_With_ID")[0].value = list_id+mydate;
}
var list_id = document.getElementsByName("InsertRecordListing_ID")[0].value;
var mydate = document.getElementsByName("InsertRecordDate")[0].value;
Further information: I suspect it might be that the onchange event is not triggering on the receiving field (Date_With_ID) because the value is being script updated and not manually typed.
Trying to find a way of forcing the change event to occur. Any advice appreciated thanks!
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
jhanajc
Hi,
Using the code below I am populating a text field on a submission form which is then used as a Parent Field on a Cascading AutoComplete Virtual field triggered when the Date field changes.
This technically works but I find that the AutoComplete field does not update immediately unless I physically visit the parent field and make a keystroke (say a type space at the end of the value).
How can I force the Cascading AutoComplete field to update immediately?
Thanks!
<script type="text/javaScript">
function concatenate()
{
mydate = document.getElementsByName("InsertRecordDate")[0].value;
document.getElementsByName("InsertRecordDate_With_ID")[0].value = list_id+mydate;
}
var list_id = document.getElementsByName("InsertRecordListing_ID")[0].value;
var mydate = document.getElementsByName("InsertRecordDate")[0].value;
document.getElementsByName("InsertRecordDate_With_ID")[0].value = list_id+mydate;
document.getElementsByName("InsertRecordDate")[0].onchange = concatenate;
</script>
Further information: I suspect it might be that the onchange event is not triggering on the receiving field (Date_With_ID) because the value is being script updated and not manually typed.
Trying to find a way of forcing the change event to occur. Any advice appreciated thanks!
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.