Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2018-07-25 06:42 AM
Hi All,
I am in the process of creating object for validating date in one of the Archer application however I am stuck with having a proper event listener for the date field, since most of the Javascript event listeners do not work inside custom object, I tried with Jquery selector aswell but that also does not seem to be responding to the event trigger, I have the following observations
1. wrapping the event trigger inside Sys.Application.add_load() or $(document).ready() does not affect the behavior of event trigger the Javascript code only works when the form is loaded and while conditional layout makes the field visible, it overlooks the event trigger always
<script type="text/javascript">
Sys.Application.add_load(function(){
$("input[name='master$DefaultContent$rts$s7604$f21390cdp']").change(console.log("value change"));
});
</script>
2. There are certain examples in community which select the wrapper div tag Id instead of the date field itself name selection but that also did not fetch any positive result.
My end goal is to have the event triggered every time the user has filled the date field i.e. onfocusout() or onblur() please share your thoughts and corrections I need to do in my script
2018-07-25 10:38 AM
One correction, star instead of dollar
$('div[id*="f' + fldId + 'cdp"]')
2018-07-25 10:41 AM
Both will work Ilya, * = contains, $ = ends with.
Advisory Consultant
2018-07-25 10:43 AM
Interesting, I just pointed out star, because it did not work for me with dollar, but thanks for the clarification.
2018-07-25 10:47 AM
Interesting that $ didn't work for you but it did for me
So will stick with star being it covers both, code updated above.
Advisory Consultant
2018-07-25 10:50 AM
Deal
2018-07-25 11:04 AM
Thanks David and Ilya for your help and inputs the second code seems to work as intended.
Appreciate your support!!!
2018-07-25 11:06 AM
It worked for me with $
2018-07-25 11:06 AM
All props to David
2018-07-25 11:20 AM
My pleasure Akshay
Glad it's working for you.
Advisory Consultant