Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Date Validation Custom Object

AkshayDaniel
Contributor III

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

18 REPLIES 18

One correction, star instead of dollar

$('div[id*="f' + fldId + 'cdp"]')‍‍

Both will work Ilya, * = contains, $ = ends with.

 Advisory Consultant

Interesting, I just pointed out star, because it did not work for me with dollar, but thanks for the clarification.

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

Deal

Thanks David and Ilya for your help and inputs the second code seems to work   as intended.

 

Appreciate your support!!!

It worked for me with $

All props to David

My pleasure Akshay

 

Glad it's working for you.

 Advisory Consultant