Focal Point
HTML Date Field Verification

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5881094262

December 20, 2007, 12:42 PM
<Tmproff>
HTML Date Field Verification
I would like to do a verification check on 2 date fields (calendar option). They default to blank, but I would like to have a small popup window that displays if either field is left empty.

The 2 fields are named begdt and enddt.

I am using the HTML layout painter.
Thank you for your help!
-Troy
December 20, 2007, 02:00 PM
wf1998
write Onmouseover/Onclick Event to check for blank and show popup
function BEGDT_onclick(ctrl) {
if (document.getElementById("BEGDT").value==" "){
alert("Beining date is empty...");

//show Calender popup window for BEGDT
}
}

function ENDDT_onclick(ctrl) {
if (document.getElementById("ENDDT").value==" "){
alert("End date is empty...");

//show Calender popup window for ENDDT
}
}
where BEGDT, ENDDT is ID's of the objects in your HTML




Env Prod:WebFOCUS 7702 ,Windows xp on 64, SQL Server 2008, IRF Tool
Env 1 Local: DevStudio 7702 - MS Windows XP SP2 - Apache Tomcat 5.0.28
Output: HTML, Excel and PDF
December 20, 2007, 02:45 PM
<Tmproff>
I'm getting an object expected error with that code. Where should I verify that BEGDT / ENDDT is the ID's of the objects?
December 20, 2007, 03:05 PM
wf1998
Hi Tmproff,

i created temporery HTML and used Beging Date and Ending Date and added Onclick events on both the Fields..

see the code below

< !-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<TITLE>HtmlPage
</TITLE>
<BASE href=HTTP://endwwebd1:8080>
<script id=clientEventHandlersJS type=text/javascript>
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
}

function BEGDT_onclick(ctrl) {
	if (document.getElementById("BEGDT").value==""){
		alert("Beining date is empty...");

		//show Calender popup window for BEGDT
	}
}

function ENDDT_onclick(ctrl) {
	if (document.getElementById("ENDDT").value==""){
		alert("End date is empty...");

		//show Calender popup window for ENDDT
	}
}
</SCRIPT>

<script for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>

This message has been edited. Last edited by: Kerry,




Env Prod:WebFOCUS 7702 ,Windows xp on 64, SQL Server 2008, IRF Tool
Env 1 Local: DevStudio 7702 - MS Windows XP SP2 - Apache Tomcat 5.0.28
Output: HTML, Excel and PDF
December 20, 2007, 03:07 PM
wf1998
Sorry HTML Code is missing in above post..

This message has been edited. Last edited by: wf1998,




Env Prod:WebFOCUS 7702 ,Windows xp on 64, SQL Server 2008, IRF Tool
Env 1 Local: DevStudio 7702 - MS Windows XP SP2 - Apache Tomcat 5.0.28
Output: HTML, Excel and PDF
December 20, 2007, 03:48 PM
<Tmproff>
That worked great, Thanks!