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:
Saef
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5226
People Online:
Visitors:
162
Members:
0
Total:
162
Online Now:
New Topics
User Group Announcements
Carolina User Group Meeting
12/20/2024 3:15 PM
Date & Time: February 6, 2025, 8:30am - 4:00pm
S3 Systems Administration
ADFS certificate - new cert
12/3/2024 9:38 PM
The certificates on the windows boxes expired and
Lawson S3 HR/Payroll/Benefits
Post Tax Benefit Plan Table
11/14/2024 9:16 PM
Hi, totally new to Laswon. I have a repor
Lawson S3 Procurement
ED501 Error: Map 850 not supported by /law/c15vda/lawson/test10/edi/bin/laws_out_91
11/12/2024 3:47 PM
Tried runnning ED501 and getting the atathced erro
Lawson S3 HR/Payroll/Benefits
Error
11/6/2024 9:54 PM
When I try to enroll a retiree in 72.1 health plan
Infor ERP (Syteline)
Syteline: New Data Maintenance Wizard (Error) Need help
11/1/2024 4:24 PM
Hi, I need help with an error on syteline while us
Dealing with Lawson / Infor
Implementing Lawson v10 with Cerner Surginet, Case Cart Picking, and Quick Adds for the OR
10/29/2024 4:20 PM
Hi Everyone, I am wondering if there is any org
Lawson S3 HR/Payroll/Benefits
Canada Tax Calculation (Federal and Provincial) Issue
10/23/2024 5:00 AM
Initially, we had problem with CPP2 calculation is
Lawson S3 HR/Payroll/Benefits
CA Section 125 401k Plan
10/22/2024 10:13 PM
Does anyone have any recommendations on how to fac
S3 Systems Administration
Running AC120 deleted records from ACMASTER table
10/22/2024 3:40 PM
We recently ran the AC120 as normal and somehow it
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3291
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1372
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
User Experience
Lawson Design Studio
Check Dates using javascript
Please
login
to post a reply.
5 Replies
0
Subscribed to this topic
12 Subscribed to this forum
Sort:
Oldest First
Most Recent First
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
Posts: 3353
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
Posts: 3353
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
Posts: 3353
8/24/2011 6:53 PM
Mondrar, I see you're lit up more green now!!
Please
login
to post a reply.