RE: Drop-down menu and redirect based on selection
Hi, I have the following dropdown menu. I would like to be able to redirect to a new page based on one of the selections below. I'm not sure of the proper syntax. CFFORM ACTION=index.cfm METHOD=GET ENABLECAB=Yes NAME=form2 nbsp;nbsp; SELECT NAME=md SIZE=1 CLASS=dirlinks onChange=parent.location='http://url' option value=url selectedhttp://url1/option option value=urlhttp://url2/option option value=urlhttp://url3/option option value=urlhttp://url4/option option value=urlhttp://url5/option /select /CFFORM ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Drop-down menu and redirect based on selection
First of all, don't use CFFORM. In fact, NEVER use CFFORM. Roll your own JavaScripts for validation instead. Second, use the following code for your nav form: form action=redirect.cfm method=post onChange select name=theurl onChange=document.forms[0].submit() option value=http://www.fusioneers.com;Fusioneers.com option value=http://www.warrick.net;Mark's Personal Site option value=http://www.houseoffusion.com;House of Fusion /select input type=submit value=Go! /form And last, make sure you've got backup code just in case the user doesn't have JavaScript turned on: ---redirect.cfm--- cflocation url=#form.theurl# addtoken=no ---mark Mark Warrick - Fusioneers.com Personal Email: [EMAIL PROTECTED] Business Email: [EMAIL PROTECTED] Phone: 714-547-5386 Efax: 801-730-7289 Personal URL: http://www.warrick.net Business URL: http://www.fusioneers.com ICQ: 125160 / AIM: markwarric -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 12:18 PM To: CF-Talk Subject: RE: Drop-down menu and redirect based on selection Hi, I have the following dropdown menu. I would like to be able to redirect to a new page based on one of the selections below. I'm not sure of the proper syntax. CFFORM ACTION=index.cfm METHOD=GET ENABLECAB=Yes NAME=form2 nbsp;nbsp; SELECT NAME=md SIZE=1 CLASS=dirlinks onChange=parent.location='http://url' option value=url selectedhttp://url1/option option value=urlhttp://url2/option option value=urlhttp://url3/option option value=urlhttp://url4/option option value=urlhttp://url5/option /select /CFFORM ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Drop-down menu and redirect based on selection
| First of all, don't use CFFORM. In fact, NEVER use CFFORM. Roll your own | JavaScripts for validation instead. Why not? For _simple_ validation, it's quick, it's easy, and it does the job. Besides, when you combine it with CF validation and then database validation on top of that, it's not quite as critical that the JS gets it 100% all the time. Besides, what if some wiseguy makes a copy of your form, alters the JS and then submits it to your site. At that point, it's the CF and database validation that really matter. Now, I know there are ways to prevent something like that from happening, but my point is, to me, JS is just a nice thing I do for the users to save them some time. I don't rely on it for any type of serious data validation/formatting. So, for me, the default stuff in cfform works just fine, unless I need the data stored in some format other than the CF_javascript will accept. Is there something I am not thinking about that I should be? Todd - Original Message - From: Mark Warrick [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, June 26, 2001 3:55 PM Subject: RE: Drop-down menu and redirect based on selection | First of all, don't use CFFORM. In fact, NEVER use CFFORM. Roll your own | JavaScripts for validation instead. | | Second, use the following code for your nav form: | | form action=redirect.cfm method=post onChange | select name=theurl onChange=document.forms[0].submit() | option value=http://www.fusioneers.com;Fusioneers.com | option value=http://www.warrick.net;Mark's Personal Site | option value=http://www.houseoffusion.com;House of Fusion | /select | input type=submit value=Go! | /form | | And last, make sure you've got backup code just in case the user doesn't | have JavaScript turned on: | | ---redirect.cfm--- | cflocation url=#form.theurl# addtoken=no | | ---mark ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Drop-down menu and redirect based on selection
No, you've thought it out thoroughly. We just differ on opinions is all. As you pointed out, the parameters of CFFORM are very limited. The issue about validation on the backend is a totally separate issue and I agree with you 100%. The reason I say you shouldn't use CFFORM is twofold: the inherent limitations and the fact that if you never write your own JavaScript validation scripts, you'll never truly understand what's going on when problems arise. It's kind of like using a WYSIWYG editor to create your site. Sure you can do it, but in doing so you loose control of the code. ---mark Mark Warrick - Fusioneers.com Personal Email: [EMAIL PROTECTED] Business Email: [EMAIL PROTECTED] Phone: 714-547-5386 Efax: 801-730-7289 Personal URL: http://www.warrick.net Business URL: http://www.fusioneers.com ICQ: 125160 / AIM: markwarric -Original Message- From: Todd Ashworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 1:31 PM To: CF-Talk Subject: Re: Drop-down menu and redirect based on selection | First of all, don't use CFFORM. In fact, NEVER use CFFORM. Roll your own | JavaScripts for validation instead. Why not? For _simple_ validation, it's quick, it's easy, and it does the job. Besides, when you combine it with CF validation and then database validation on top of that, it's not quite as critical that the JS gets it 100% all the time. Besides, what if some wiseguy makes a copy of your form, alters the JS and then submits it to your site. At that point, it's the CF and database validation that really matter. Now, I know there are ways to prevent something like that from happening, but my point is, to me, JS is just a nice thing I do for the users to save them some time. I don't rely on it for any type of serious data validation/formatting. So, for me, the default stuff in cfform works just fine, unless I need the data stored in some format other than the CF_javascript will accept. Is there something I am not thinking about that I should be? Todd - Original Message - From: Mark Warrick [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, June 26, 2001 3:55 PM Subject: RE: Drop-down menu and redirect based on selection | First of all, don't use CFFORM. In fact, NEVER use CFFORM. Roll your own | JavaScripts for validation instead. | | Second, use the following code for your nav form: | | form action=redirect.cfm method=post onChange | select name=theurl onChange=document.forms[0].submit() | option value=http://www.fusioneers.com;Fusioneers.com | option value=http://www.warrick.net;Mark's Personal Site | option value=http://www.houseoffusion.com;House of Fusion | /select | input type=submit value=Go! | /form | | And last, make sure you've got backup code just in case the user doesn't | have JavaScript turned on: | | ---redirect.cfm--- | cflocation url=#form.theurl# addtoken=no | | ---mark ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists