Hi Dave

the line -  if(oForm.discode.value != 'xyz123' && oForm.discode.value != 
'abc1234') { is giving an error - saying Expected ';'

also i wanted to claify - i might not have been so clear in my request...

the user could enter 1 of 2 possible entries into the non-required field... 
'xyz123' OR 'abc1234'

i only add that in because it looked like in the coding below - that it would 
only accept the answer of 'xyz123' - do you know how you could have it check 
for both?

Thank you!!

>Christine,
>
>I believe you will need to do some custom javascript validation for this
>(someone who has used cfform a lot can surely suggest otherwise).  Here's
>how you could do it:
>
>Add the following to cfform tag 'onsubmit="return doSubmit();"
>
>Then, inside your <head> tags, add the following:
>
><script>
>vunction doSubmit() {
> var oForm = document.formname;
> if(oForm.discode.value != 'xyz123' && oForm.discode.value != 'abc1234') {
>  alert('put your error message here');
>  return false;
>}
>// if we are here, then one of the values were entered.
>  if(oForm.discode.value == 'xyz123') {
>    oForm.paytype[0].checked = true;
>  }
>  else {
>    oForm.paytype[1].checked = true;
>  }
>  return true;
>}
></script>
>
>This is as assuming that your first radio button is NAxyz123 and your second
>radio button is NAabc1234.   You can adjust accordingly, but this should get
>you on the right track.
>
>DISCLAIMER:  I have not tested the above code - so it may not be bug free.
>:)
>
>Dave
>HI
>
>I need assistance with cfform validation, please.
>
>I have a text field 'discode' that is not required however if it is filled
>out it can only have 2 possible answers in it: 'xyz123' or 'abc1234'.
>
>And then if the 'discode' field is filled out correctly with 1 of those 2
>values then another radion button field 'paytype' needs to be set to
>'NA#discode#'.
>
>can anyone help me? thank you. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311017
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to