Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
User Experience
Lawson Design Studio
Check Dates using javascript
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Chris Radcliffe
Past 24 Hours:
0
Prev. 24 Hours:
1
Overall:
5187
People Online:
Visitors:
274
Members:
0
Total:
274
Online Now:
New Topics
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
Lawson Business Intelligence/Reporting/Crystal
Domain Name Change
3/5/2024 7:45 PM
Our domain name needs to change and was hoping I c
S3 Customization/Development
Cobol calling Shell Script
2/29/2024 1:27 PM
Has anyone created or modified a Lawson Cobol prog
Infor ION
ION vs IPA
2/29/2024 1:24 AM
We had a person new to Lawson and Infor go to Info
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1348
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Lawson Design Studio
Check Dates using javascript
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
mondrar
Advanced Member
Posts: 35
5/14/2007 8:25 PM
How can I check the value of a field that is defined as a date field after the date has been selected using javascript. I want to check the date chosen, and if it's not equal to a prededined date, alert the user. Below is the javascript that I threw together that gets me half way there.
function TEXT_OnBlur(id, row)
{
if (id != "text85") return true;
{
var vDmeString = portalWnd.DMEPath;
vDmeString += "?PROD="+strPDL;
vDmeString += "&FILE=APVENGROUP";
vDmeString += "&FIELD=GRP-END-DTE-01;GRP-END-DTE-02;GRP-END-DTE-03;GRP-END- DTE-04;";
vDmeString += "GRP-END-DTE-05;GRP-END-DTE-06;GRP-END-DTE-07;GRP-END-DTE-
08;GRP-END-DTE-09;";
vDmeString += "GRP-END-DTE-10;GRP-END-DTE-11;GRP-END-DTE-12;GRP-END-DTE-
13";
vDmeString += "&XCOLS=TRUE";
vDmeString += "&XKEYS=TRUE";
vDmeString += "&XRELS=TRUE";
vDmeString += "&XCOUNT=TRUE";
vDmeString += "&XIDA=TRUE";
vDmeString += "&OUT=XML";
// send the DME call to the server
var vDMEInfo = portalWnd.httpRequest(portalWnd.DMEPath + vDmeString);
if (!vDMEInfo || vDMEInfo.status)
{
var msg="Error calling DME, ";
msg += (vDMEInfo
? "(status code): "+vDMEInfo.status
: "bad server response.");
alert(msg);
return true;
}
// create an XML object to contain the DME data
var vObjDMEXML = new portalWnd.DataStorage(vDMEInfo);
// load a variable with the records returned by DME
var vRecords = vObjDMEXML.document.getElementsByTagName("RECORD");
if (vRecords.length == 0)
{
alert("No Dates Found");
return true;
}
var vCols = vRecords[0].getElementsByTagName("COL");
var SDate = lawForm.getFormValue("text85");
if (SDate != (vCols[0].firstChild.data ))
{
alert ("this is a test")
}
//alert ("Picked Date " + SDate)
//alert (vCols[0].firstChild.data )
//alert (vCols[1].firstChild.data )
//alert (vCols[2].firstChild.data )
//alert (vCols[3].firstChild.data )
//alert (vCols[4].firstChild.data )
//alert (vCols[5].firstChild.data )
//alert (vCols[6].firstChild.data )
//alert (vCols[7].firstChild.data )
//alert (vCols[8].firstChild.data )
//alert (vCols[9].firstChild.data )
//alert (vCols[10].firstChild.data )
//alert (vCols[11].firstChild.data )
//alert (vCols[12].firstChild.data )
//alert (vCols[13].firstChild.data )
return true;
}
}
mondrar
Advanced Member
Posts: 35
5/14/2007 8:28 PM
I would like to do this once the user tabs or moves away from the field. Any ideas would be appreciated.
John Henley
Senior Member
Posts: 3348
5/15/2007 2:05 PM
I'm not a big fan of 'OnBlur', since you can't trust it to get fired consistently. I use FORM_OnBeforeTransaction instead when I want to put in that type of code, checking the 'fc' that is passed so that the code is only executed on an add or change but not a delete, or other special actions.
To handle the date edits, you need to make sure that the date format you're looking at via the DME call is consistent with the format of what the user is entering on the screen. The problem is that the user entry format is not necessarily consistent from user to user, browser to browser, etc. This is particularly an issue when your users have different locales. So, you need to put what they enter into a 'Date' JavaScript variable, and also do the same with the DME return value. Then you're comparing apples-to-apples!
Here's the article with code to convert the user's input into a locale-independent variable:
https://www.lawsonguru.co...t-Date-Function.aspx
Hopefully, that will be enough to get you going...
mondrar
Advanced Member
Posts: 35
5/15/2007 6:10 PM
I never even thought about manual data entry. I was assuming the user would choose the date from the calander, never assume. I think I am going to check the 'fc' that is passed, as I have done this on a few other forms. Thanks for the help...
By the way, how come I have one orange bar, and you are all lit up green? I want to be green...
John Henley
Senior Member
Posts: 3348
5/15/2007 6:36 PM
C'mon Richard--no self-respecting data entry person uses a wimpy drop-down calendar...they type it in! :)
Orange vs. green...you need to submit / answer lots of questions... it's based on how many times you've posted to the LawsonGuru forums.
John Henley
Senior Member
Posts: 3348
8/24/2011 6:53 PM
Mondrar, I see you're lit up more green now!!
You are not authorized to post a reply.