You can also use the same <cfif> statement to display a text message on your page incase JS is not on.
And to be picky... <cfif not logon.recordcount> <cfsavecontent variable="js"> <script type="text/javascript"> alert("Invalid Login Message"); </script> </cfsavecontent> <cfhtmlhead text="#js#" /> <div style="color:red;">Invalid Login Message</div> <cfinclude template= "display_login_page.cfm" /> <cfelse> User logged in. </cfif> This code ensures that the javascript block is between the <head></head> tags and will also give you a non-js message to make sure the message is seen by everyone. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield HYPERLINK "http://acoderslife.com/"http://acoderslife.com -----Original Message----- From: Charlie Hanlon [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 5:26 PM To: CF-Talk Subject: Re: CF/JavaScript help on signup <cfif not logon.recordcount> <script type="text/javascript" language="JavaScript"> alert("In-Valid Login Message"); </script> <cfinclude template= "display_login_page.cfm"> </cfif> hth Elena Charlie Hanlon Web Apps Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference ----- Original Message ----- From: "Aminova, Elena" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Monday, October 24, 2005 5:20 PM Subject: CF/JavaScript help on signup > Please advise what I can do in Cold Fusion, perhaps using JavaScript? > I have a login page and on it, I need when the user enters wrong > username and/or password which don't match up in the DB, I need to pop > up or display a user friendly message that the entry does not match up, > doesn't matter what the message is. Right now I just do this in the > login processing page: > > <cfif not logon.recordcount>(logon is the query that checks the DB if > there are any records with the form inputed username and password) > <!--- Need to display or Pop up a message that the users username and > password dont match/ are not correct ---> > <cfinclude template= "display_login_page.cfm"> > <cfabort> > > PLEASE HELP!!! > > Thanks. > > Elena > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222142 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