Yeah it was the missing return in the function call. I didnt want the onSubmit because this form had 2 submit buttons. I needed this to be a separate function, however that got it and I appreciate it!
On Fri, 17 Dec 2004 15:54:57 -0500, Ray Champagne <[EMAIL PROTECTED]> wrote: > How are you calling the function? > > You should be calling it like this: > > onSubmit="javascript: return subForm();" > > and add: > > return true; > > to the else clause. > > This drove me crazy a few weeks ago. > > Ray > > At 03:52 PM 12/17/2004, you wrote: > >I have a button which calls a JS function > >I'm checking to see if a date is prior to another.. if not then the > >function should alert the user and return out of the function. If it's > >prior to the end date then the function should change the action of > >the form and then submit the form. > > > >I have this.. > >function subForm() > >{ > > if (document.siteReferrals.StartDate.value > > >document.siteReferrals.EndDate.value) > > { > > alert("Your Start Date must be before your End Date"); > > return false; > > } > > else > > { > > document.siteReferrals.action='Report-SiteReferrals.cfm'; > > document.siteReferrals.submit(); > > } > >} > > > > > >No matter what it always submits the page. > >Even if it alerts me that the start date is greater then the end date. > > > > > >-- > >Auxilium meum a Domino > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188264 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54