Copy link to clipboard
Copied
Good day everyone please i'm a beginner in coldfusion. i really need your help i've read books about coldfusion but i dont understand them. is there any book for a beginner like me
Hi Felix, welcome to the world of ColdFusion. Which books have you been reading?
Search the web for Coldfusion tutorials for beginners. I would recommend Learn CF in a Week. You should return to this forum with any questios you may have.
Copy link to clipboard
Copied
can't cast [23,9,1993] to date value |
That's the error i'm getting
Copy link to clipboard
Copied
Please give us the full error. It should say what line of the code is the issue. You may need to go into the ColdFusion administrator and enable robust exception info under debugging and logging.
Copy link to clipboard
Copied
an't cast [9,9,1993] to date value | |
Stacktrace | The Error Occurred in /home/felix/Desktop/lucee/webapps/www/felix/page/form/reg.cfm: line 32 30: <cfqueryparam value="#Form.optionphone#" cfsqltype="cf_sql_varchar">called from /home/felix/Desktop/lucee/webapps/www/felix/index.cfm: line 49 47: |
thats the full error
Copy link to clipboard
Copied
This is not a valid date format. Where are you getting this string from? I also notice in your code above, you have the same name / ids on all your select elements. This is incorrect, ids have to be unique for a start.
Copy link to clipboard
Copied
so how do i go about it in the select element.
Copy link to clipboard
Copied
'#Form.sex#'
<cfqueryparam value="#Form.sex#" cfsqltype="cf_sql_char">
or
<cfqueryparam value="#Form.sex#" cfsqltype="cf_sql_varchar">
can't cast [23,9,1993] to date value
That's the error i'm getting
The error message is obvious enough. I think 23-09-1993 or 23/09/1993 would work.
Copy link to clipboard
Copied
God Bless you all.
i have found solution to my problem. I love you all
Copy link to clipboard
Copied
felixm71880667 wrote:
God Bless you all.
i have found solution to my problem. I love you all
I am glad to hear. Could you please describe here your solution here. It will help someone else in future. Thanks for the love.
Copy link to clipboard
Copied
<cfif isDefined("form.save")>
<cfset felix = "#form.dob#" />
<cfset #form.dob# = "#felix#" />
<cfdump var="#form#"/>
</cfif>
<!---Date--->
<div class="form-group">
<input class="form-control" type="date" name="dob">
</div>
<!---End of Date--->
that's how i corrected it
Copy link to clipboard
Copied
A couple of things to note. First - in your original form code, as others stated, you had three select inputs that had the same name. When a form with multiple inputs with the same name is submitted to ColdFusion, the values of those inputs are automatically combined into a comma-delimited list in a single FORM variable (as you were seeing). There is an application-level setting in ColdFusion 11 that will instead turn the values of multiple same-named inputs into an array instead of a list.
Second, it appears that you are actually running Lucee and not Adobe ColdFusion (at least that is what I see in the post where you showed the error message). While general CFML questions will likely be answered in this forum, keep in mind the forum is intended for users of Adobe ColdFusion. Lucee has it's own community support via the Lucee Google Group.
-Carl V.