I am new to cold fusion and have limited skills. My email form is working in a basic sense. I am getting an error at the bottom of my page, but I can still enter information and it emails the information correctly.
The error is:
--------------------------------------------------------------------------------
Error Diagnostic Information
An error occurred while evaluating the expression:
#Form.Hear#
Error near line 113, column 46.
Error resolving parameter FORM.HEAR
The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.
The error occurred while processing an element with a general identifier of (#Form.Hear#), occupying document position (113:45) to (113:55).
I also get an error when I don't fill in the checkbox and it DOES NOT email the information correctly in this case. The error is:
--------------------------------------------------------------------------------
Error Diagnostic Information
An error occurred while evaluating the expression:
#Form.Credentials#
Error near line 117, column 15.
Error resolving parameter FORM.CREDENTIALS
The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.
The error occurred while processing an element with a general identifier of (#Form.Credentials#), occupying document position (117:14) to (117:31).
It appears I need to setup some coding so if no information is answered in the checkbox question the form still is submitted without an error.
Lastly, I want to redirect the page once the information/form is submitted to a new website page:
http://jumpstart-l.puttinontheweb.com/scripts/wa.exe?SUBED1=jumpstart&A=1
If there is a tutorial that explains these very things, please let me know. I did look at several tutorials but nothing covered exactly what I wanted.
My coding for the form is below. Thanks for your help.
Where user heard about Jump Start Listserv: #Form.Hear#
If completed Other: #Form.HearOther#
Area of Practice: #Form.Practice#
If completed Other: #Form.PracticeOther#
Credentials: #Form.Credentials#
If completed Other: #Form.CredentialsOther#
I take it that the <cfmail> block is only evaluated when the form fields are available, ie: after form submital? If not, it's what's causing your problem. I'll show you the easiest way to do this.
Regarding the checkbox, the problem is due to the fact that if no box is checked, the variable will not be present on the target page. The easiest wat to fix this, in your case, would be to use radio buttons for the Credentials element instead. It's of course possible to keep using a checkbox if you'd like, but I think radio buttons are more appropriate for this particular question in any case.
In your case the easiest way to do the redirect is probably with cflocation (http://livedocs.macromedia.com/cfmxdocs/CFML_Reference/Tags-pt166.jsp#1100753).
For whatever value you want to be the default, add selected="selected" to the input tag. It's important that you do this, otherwise, if the user forgets to choose one an error will be produced.