ceb39
05-04-2004, 10:31 PM
I have a CFFORM which is working okay. It contains a set of three radio buttons and a set of two radio buttons. I have set up a radio button (CFINPUT TYPE ="Radio" ...) in each set as the CHECKED button. What I really would like is to not use CHECKED (I am sure a form users will skip over this and submit the form with the wrong button selected if CHECKED is used), but drive the user to select one of the radio buttons. Something like using the REQUIRED and MESSAGE options in a type TEXT field.
I have searched quite a few sites for something along this line but as of yet have found nothing specific to this situation.
Thanks
Chuck
If you leave the radio buttons unchecked one way to fix things is to check if the parameter has been passed to the target page then redirect if it hasnt
eg say your form is being submitted to process.cfm
then on process.cfm you put something to check CFIF the parameter isDefined() and use javascript onload to first alert them to the problem then second send the visiter back so the form they filled in is still filled in
<CFIF IsDefined("FORM.daRadioName")>
<BODY>
<P>Because the variable FORM.daRadioName has been defined, we
can now proceed<P>The value of "FORM.daRadioName" is <B><I><CFOUTPUT>#FORM.daRadioName#
</CFOUTPUT></I></B>
<CFELSE>
<BODY onload="alert('fill in a value for daRadioName');history.go(-1);">
<P>The variable
"FORM.daRadioName" has not yet been defined, so it is not evaluated. Send them back
</CFIF>
There are probably other ways
ceb39
05-10-2004, 04:41 PM
That is an interesting approach, will give it a try and let you know what happens.
Thanks
Chuck
Well thats a week or so...
So what happend???
vBulletin® v3.6.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.