Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
11 subscribers
Views
2104 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
In one of my form, I've created a Java Script function to control that vario
olivierd
over 10 years ago
In one of my form, I've created a Java Script function to control that various dates entered are business day; the validation works well.
Within the process, there is an opportunity for users to go back to that form to change their data. At that moment, it looks like that the validations of dates is somehow removed from the fields and by default return false, which actually blocked then the whole form (I've added alert in the JS to check if they are displayed, but it's really look like the dates are not validated anymore). But, when the form is re-open using the monitoring view, validations work again... Could you please help me with that? Any idea of where it could come from? Thanks!...
OriginalPostID-100950
OriginalPostID-100950
Discussion posts and replies are publicly visible
Parents
0
olivierd
over 10 years ago
It was not check, I tried to run it again with the Refresh default values check but it didn't work again. JavaScript is the following:
function validateDay(dayField) {
var dateString= FormAPI.getValue(dayField).id;
//Return european format dd/mm/yyyy
var arr = dateString.split('/');
var day = arr[0];
var month= arr[1];
var year = arr[2];
var dateString2= year+"/"+month+"/"+day;
//created using american format yyyy/mm/dd
var currentDate = new Date(dateString2);
var d = currentDate.getDay();
if(d > 0 && d < 6)
return true;
else
return false;
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
olivierd
over 10 years ago
It was not check, I tried to run it again with the Refresh default values check but it didn't work again. JavaScript is the following:
function validateDay(dayField) {
var dateString= FormAPI.getValue(dayField).id;
//Return european format dd/mm/yyyy
var arr = dateString.split('/');
var day = arr[0];
var month= arr[1];
var year = arr[2];
var dateString2= year+"/"+month+"/"+day;
//created using american format yyyy/mm/dd
var currentDate = new Date(dateString2);
var d = currentDate.getDay();
if(d > 0 && d < 6)
return true;
else
return false;
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data