- see footer for list info -<
Pete Dray wrote:
- see footer for list info -<
I have a simple teplate (below) that is behaving oddly.

The javascript does not run unless I put a cfabort after the closing
script tag. I thought it may be the cflocation tag so I replaced it
with a javascript location.href effort to no avail.

Any pointers?
You're mixing client and server side scripting here and the cflocation is taking precedence over the javascript.

I'm guessing that when someone submits a form where they can change the email address of their account you want to prompt them to make sure that they really do want to change the email address. You need to check the email addresses using javascript back on the display form, using onsubmit, rather than in your action template. Make sure you have both order and user email address as fields in your form, even if one of them is in a hidden field, and compare the two form field when the user submits the form and if they don't match ask the question "Are you sure?". If they are sure let the form submission go ahead and then deal with just changing the details and whatever other actions are required dependant on the form field content. If they aren't sure, don't let the form submission go through to the action page at all.

Flaw in the plan - if your user has JS disabled in their browser the form will submit no matter what.

Hope this helps

Regards

Stephen
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to