Also agreed. CFForm works great! Thanks. RO HWW
-----Original Message----- From: "Will Swain" <w...@hothorse.com> Sent: Saturday, March 27, 2010 5:55am To: "cf-talk" <cf-talk@houseoffusion.com> Subject: RE: (ot) email confirm Agreed with Bryn. Look at cfform, or if you don't want to for some reason, look at something like jQuery's form validation plugins: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Cheers Will -----Original Message----- From: Bryn Parrott [mailto:bryn_parr...@internode.on.net] Sent: 27 March 2010 00:34 To: cf-talk Subject: Re: (ot) email confirm > Sorry folks a little off topic here, but I'm not good at javascript. > I have this email confirm code that tells me I need to enter a valid > email, but then still sends me to the next form which generates an > error because of no email address. > The problem seems to be in this section not stopping the submission so > that the user can enter a valid email > --------------------------- > if (goodEmail){ > good = true > } else { > alert('Please enter a valid e-mail address.') > field.focus() > field.select() > good = false > } > } > --------------------------- > Any help appreciated. > RO > HWW > The full code is below: > var good; > function checkEmailAddress(field) { <snipped> I gather that you are firing this function when the submit button on the form is clicked. Assuming that to be the case, if the validation is OK, return TRUE from the function call, and if the validation is incorrect, then return FALSE. This should stop the form from being submitted inappropriately. But the other buy was right in regards CFForm, as that is a much simpler way of handling the whole thing.. HTH Bryn Assumng that ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332403 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm