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
1 reply
Subscribers
7 subscribers
Views
998 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
We are on release 7.2. I have a string field I'm validating and display a p
scotte
over 9 years ago
We are on release 7.2. I have a string field I'm validating and display a popup. This works great, but after clicking OK on popup I want focus to return back to the field. In the script below I get js error when I leave in the "return true", "return false". From the code below how can I get focus back on field in error? The only code you need to look at is at end where the "If" statement is. The field DOB_Entered is the form field I'm checking. Thanks!
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
today = yyyy + "" + mm + "" + dd;
var tstdate = FormAPI.getValue("DOB_Entered").id.substring(0);
var tstdate = tstdate.split("/").join("");
tstdate = tstdate.substring(0,2)+"/"+tstdate.substring(2,4)+"/"+tstdate.substring(4);
var splitDate = tstdate.split("/");
var compareDate = new Date(splitDate[2] + "" + splitDate[0] + "" + splitDate[1]);
var monthfield=splitDate[0];
var dayfield=splitDate[1];
v...
OriginalPostID-140191
OriginalPostID-140191
Discussion posts and replies are publicly visible
Parents
0
scotte
over 9 years ago
...ar yearfield=splitDate[2];
var dayobj = new Date(yearfield, monthfield-1, dayfield);
if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))
{
window.FormAPI.setValue("DOB_Entered","");
alert("Invalid Day, Month, or Year range detected. Please correct.");
return false;
else
return true;
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
scotte
over 9 years ago
...ar yearfield=splitDate[2];
var dayobj = new Date(yearfield, monthfield-1, dayfield);
if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))
{
window.FormAPI.setValue("DOB_Entered","");
alert("Invalid Day, Month, or Year range detected. Please correct.");
return false;
else
return true;
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data