Hi there,
Having problems with a cfif query based on the value of a check box.
I have an input type="file" field on a form. This allows the user to choose a file and upload the location to the database. Alas, I`m networked, and everyones drives are on different letters, so I need to strip out the first three characters and add them to the server & share.
I can do this, but not in conjunction with a check box - basically saying that if this box if unchecked I don't want to complete the file location field.
CF throws an error saying it can't strip characters from a null value. Can anyone take a look and tell me where I am going wrong?
Checkbox is called 'form.Completed YN'
Server Location drop down is called 'form.FileServe rFK'
File browser box is called 'form.FileLoc'
Thanks
Neil
Having problems with a cfif query based on the value of a check box.
I have an input type="file" field on a form. This allows the user to choose a file and upload the location to the database. Alas, I`m networked, and everyones drives are on different letters, so I need to strip out the first three characters and add them to the server & share.
I can do this, but not in conjunction with a check box - basically saying that if this box if unchecked I don't want to complete the file location field.
CF throws an error saying it can't strip characters from a null value. Can anyone take a look and tell me where I am going wrong?
Checkbox is called 'form.Completed YN'
Server Location drop down is called 'form.FileServe rFK'
File browser box is called 'form.FileLoc'
Code:
<cfparam name="form.CompletedYN" default="0">
insert into tblTaskBooker
(FileLoc)
values
(<cfif #form.CompletedYN# EQ 0>
No File Location Assigned
<cfelse>
<cfset FileLocation = '#form.FileServerFK#' & #RemoveChars('#form.FileLoc#',1,3)#>
'#FileLocation#'
</cfif>
Neil
Comment