I just said--ColdFusion is already using OnSubmit for one of it's validation functions. I believe the problem lies within "return" before the onclick. When I remove it, it functions, although it continues to submit the form.
That doesn't work for me in IE 5.5 (it just submits the form with no alert). This is the exact HTML from the page:
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<SCRIPT>
function todayDate(date, old)
{
var f = new Date(date);
var n = new Date(old);
if (f <= n)
{
return true
}
else
{
alert("Please enter an assigned date that is before the due date."
return false;
}
hey, coldfusion doesn't use onsubmit
there is NO problem at all calling a jscript function in the onsubmit to validate inputs and do the treatments on the called page with coldfusion - usually it's the way people use it !!!!!
I'm using CFFORM, which uses OnSubmit. When I try to define an OnSubmit value in the CFFORM tag, I get a CF error. Anyway, I figured out that the code does indeed work for MM/DD/YYYY formatted dates, but I was entering MM/DD/YY dates. Is there anyway to make this function work with MM/DD/YY date formatting?
i find weird the way you do that ! it's not very logical !
either you use cfform, and then you should use coldfusion date validation/date comparaison functions, they are designed for that !!!
or you want to use javascript validation/comparaison functions, and then a simple <form> is better than a <cfform>
I won't use CF date comparison because I want it client side. I am already using CFFORM to ensure that the date is properly formatted. Prior to the date comparison my JavaScript knowledge didn't have to be that great--and that is why I chose CFFORM--considering that all I needed was one date comparison function. I didn't realize that problems that would arise--anyway, onClick should function just the same as onSubmit.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.