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:
Alanna
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5294
People Online:
Visitors:
243
Members:
0
Total:
243
Online Now:
New Topics
Lawson Portal
Lawson ESS customization
6/23/2025 10:28 AM
I want to add new links and customize the ESS (sel
S3 Security
Securing forms and programs that use Company Group
6/17/2025 5:41 PM
Is there a way to write a rule, that looks up a co
S3 Customization/Development
Self-Serve Customization and Modification of home page
6/17/2025 3:40 PM
Hi, I want to add new links and customize the E
S3 Customization/Development
Data / List view on Lawson Portal
5/21/2025 2:37 AM
Client is on S3 V10. All delivered and custom form
Lawson S3 Financials
Applying credits to open AP invoices
4/28/2025 1:26 PM
Hello, I am new to the Lawson system and after ru
Lawson S3 Financials
Lawson APIA
4/28/2025 1:22 PM
Has anybody recently installed Lawson's APIA m
Lawson S3 Procurement
Tolerance Settings
3/31/2025 2:01 PM
I've been trying to set a tolerance for some t
Dealing with Lawson / Infor
Printing Solutions other than MHC
3/27/2025 1:00 PM
What are others using for printing solutions besid
Lawson S3 Procurement
Green check marks in Lawson 9.0.1
3/20/2025 4:55 PM
Hi, How to remove green check mark on items when o
Lawson S3 HR/Payroll/Benefits
Pay Rate History to Show All Positions
2/26/2025 3:34 PM
Does anyone know how to modify payratehistory.htm
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
1377
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
Split
I would like to do this once the user tabs or moves away from the field. Any ideas would be appreciated.
John Henley
Posts: 3355
5/15/2007 2:05 PM
Split
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
Split
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: 3355
5/15/2007 6:36 PM
Split
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: 3355
8/24/2011 6:53 PM
Split
Mondrar, I see you're lit up more green now!!
Please
login
to post a reply.