Jake,
        Its easier to put <cfparam> tags on the question.cfm page.

Something like <cfparam name="form.q1" default="">

CFparam will set a default value if the value does not exist.  So if they
checked the button, then the value is not changed.  If they did not check
the button an thus the field does not exist, then cfparam will set the
default to "".  This then allows the SQL statement to work.

Brian Knott

-----Original Message-----
From: Jake A [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 18 November 2003 1:07 PM
To: CFAussie Mailing List
Subject: [cfaussie] Form verification and creating a hidden field on
submit


Hi All, 

I have a form that has a number of radio boxes and input fields for the
user to select from. The form is part of a survey. The problem is that the
form relies on a form field being populated once submitted. If the user
decides that they don't want to answer the question (which is a valid
option for the survey). It will cause a error when updating the database
later in the process. I was hoping to use Server-side validation instead
of Client-side

What i need the form to do is check to see if the user has input any
information into the form field if not populate a hidden field.

It would be something like this: 

<form name="form" method="post" action="question.cfm"> 

<input type="radio" name="q1" value="yes"> 
<input type="radio" name="q1" value="No"> 
<textarea name="q1" wrap="virtual" cols="75" rows="5"></textarea> 

<input type="submit" name="Submit" value="submit"> 

<!--- if form has been answered go to question.cfm ----> 
<!--- if form has not been answered add ---> 
<input type="hidden" name="q1" value"no response"> 
<!--- then go to question.cfm ----> 

</form> 

Thanks 

Jake

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to