Hello
i have this.
i want to insert values like blue, yellow, or red
in the database field col_Radio.
what do i have to change to make this work?
thank
ERROR:
Element RADIOV is undefined in FORM
Exceptions
15:53:22.022 - Expression Exception - in
C:\CFusionMX7\wwwroot\ACT_inputcolor.cfm : line 10
Element RADIOV is undefined in FORM.
note: line 10 is '#Trim(Form.RADIOV)#',
--------------------------------------------------------
What do I have to change for the element radiov to be defined or is this the
only error??
here is the first page:
<html>
<head>
</head>
<body>
<cfform name="myform" action="ACT_inputcolor.cfm" method="POST">
<div align="center"><br>
<input type="radio" name="group1" value="Blue"> Blue<br>
<input type="radio" name="group1" value="red" checked>red<br>
<input type="radio" name="group1" value="yellow"> yellow
</div>
<INPUT TYPE=SUBMIT VALUE="submit">
<td width="1"></td>
</tr>
</cfform>
</table>
</form>
</body>
</html>
<!-----------here is the action page----------->
<cfquery name="InsertRadiocolor"
datasource="#Request.MainDSN#">
INSERT INTO Tab_radio_color(
col_Radio,
)
VALUES (
'#Trim(Form.RADIOV)#'
)
</cfquery>
ForumUser - 29 Jun 2007 00:17 GMT
Change Form.RadioV (which is not defined in your form) to Form.Group1.
susanring - 29 Jun 2007 15:25 GMT
thanks i changed it but i got this error.
Error Executing Database Query.
7:23:13.013 - Database Exception - in C:\CFusionMX7\wwwroot\ACT_inputcolor.cfm
: line 10
Error Executing Database Query.
line 10 is :
'#Trim(Form.Group1)#'
<cfquery name="InsertRadiocolor"
datasource="#Request.MainDSN#">
INSERT INTO Tab_radio_color(
col_Radio,
)
VALUES (
'#Trim(Form.Group1)#'
)
</cfquery>
susanring - 29 Jun 2007 15:26 GMT
cf_dev2 - 29 Jun 2007 02:33 GMT
In other words, the FORM variable name should be the same as your <input> field name.
When you submit your form, this
<input name="group1" ...>
Becomes
#FORM.group1#