|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Creating a form in cf, issues, please help
Hello;
I am writting a form in CF 8. I have a couple questions on some issues. I will put them down 1 at a time. 1. I am trying to use a select box in my form. I have cfinputs in the form, and this is my code for the select <select enabled="No" name="timeDay" multiple="no"> <option>-- Please choose one --</option> <option>MORNING</option> <option>AFTERNOON</option> <option>EVENING</option> </select> Is this the proper way to use a select function in a cfform tag with no dynamic data in it? Now another part of this question is this: When it goes to my cfmail, I am defining the select like this: <cfparam name="form.timeDay" default=0> <cfmail> <!--- all the cfmail code stuff goes here ---> <cfif form.timeDay>#form.timeDay#</cfif> </cfmail> Is this the proper way to write out the selection in cfmail? One last aspect of this function is validation. I am using server sided validation on this form. There is another form on the response page if you missed certain fields, but the form on responce remembers what you entered in certain fields like the following: <cfinput type="text" name="name" message="Please enter your name!" validateat="onSubmit" validate="noblanks" required="yes" class="md_Inputs" value="#FORM.name#" size="60"> See the value fields, how would I make a select remember your selection from the original form like you do with a cfinput? I have a couple other questions, but want to take care of the select box first. Then I will post the other questions, they are kind of easy. Thank You! Codemonger |
|
#2
|
|||
|
|||
|
1. There really is no "proper" way, just what works for your given problem space. It's certainly common to do it that way.
2. Again, no "proper" way, since the solution depends on what you're doing. But using cfparam to default the value is an option, as long as it is not necessary for them to pick an option. 3. You can just use a cfif to determine which option to select. Regards, Brian
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Quote:
LOL I figured it out and got it to work. I just kept on playing with it in different ways. I did use a cfif in the body of the send mail and a cfperam set to default 0 also had to add in the option a value. Thanks for the help Took about an hr of playing around with it to get it working.Mike |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Creating a form in cf, issues, please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|