- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2017 11:55 PM
Not sure if this is a bug or if something else is going on that I'm unaware of.
I have a Date field on my RP which has an onLoad client script which sets the date to some point in the future.
I have an onChange Catalog Client Script which verifies a few things about that date.
- If I use the date picker to select a date, it works fine.
- If I manually change the date using the cursor and keypad (i.e. 7/20/2017 -> 7/21/2017 without using the date picker), the onChange is called 2 times.
I know the onChange isn't calling itself as I have commented out the code that does any sort of setValue.
Any thoughts? is this a known bug?
Easily reproducable, simply add a Date field (not DateTime) to a RP, add on onChange that does nothing more than alert(newValue), attempt to change the date without using the date picker. You'll see the alert called 2 times. This works totally fine in the form view.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 01:21 AM
We faced this issue earlier and reported the same to Hi and it comes out to be a product defect and created a problem ticket for the same. We come up with a workaround of moving the onChange client script to onSubmit client script. Also try to add below condition in the script and check if its working fine by then.
if(newValue == oldValue){
return;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:04 AM
Hi Adam,
In your onchange script ,
Do you have the below lines commented out removed ? If isloading is not there then it will execute both onload and onchange.
if (isLoading || newValue == '') {
return;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 01:21 AM
We faced this issue earlier and reported the same to Hi and it comes out to be a product defect and created a problem ticket for the same. We come up with a workaround of moving the onChange client script to onSubmit client script. Also try to add below condition in the script and check if its working fine by then.
if(newValue == oldValue){
return;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 01:31 PM
So I was able to keep in in the onChange, I did find that adding the newValue == oldValue into the isLoading if statement fixed it. Thanks