|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Radio Button Problem
I'm very new to using CF, so please forgive me if I'm asking a stupid question. I've searched through the documentation and the forum for an answer to my question, but had no luck.
I have a simple CFMAIL form that I'm using for a survery and it works fine with checkboxes for one of the questions, but it stops working when I use radio buttons instead. I'd prefer to use the radio buttons if I can figure out what I'm doing wrong. The form seems to function properly, but I don't get the e-mail. I received the message without a problem before I swapped the checkboxes out for the radio buttons. Here's the code for my buttons on my form page. <p> <font size="2" face="Arial, Helvetica, sans-serif"> <input name="question32" type="radio" value="highincrease">High Increase<br> <input type="radio" name="question32" value="mediumincrease">Medium Increase<br> <input type="radio" name="question32" value="lowincrease">Low Increase<br> <input type="radio" name="question32" value="highdecrease">High Decrease<br> <input type="radio" name="question32" value="mediumdecrease">Medium Decrease<br> <input type="radio" name="question32" value="lowdecrease">Low Decrease</font></p> I use this above my cfmail code: <CFIF IsDefined("form.Question32")> and use this after the </cfmail> tag. </CFIF> This is what I have for question 32 inside the cfmail tags: Question 32: #Form.Question32# Does anyone have any idea what I'm doing wrong? |
|
#2
|
|||
|
|||
|
What error are you getting? Also, I see you don't have a default selection for the radio button. Are you selecting something? If not then the form filed is NOT defined on the action page.
__________________
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
|
|||
|
|||
|
I'm not getting an error. It displays the thank you page that's below the cfmail closing tag just like it would if it had actually submitted the information.
I changed the form input information to this: <input type="radio" name="question32" value="highincrease" checked>High Increase<br> <input type="radio" name="question32" value="mediumincrease">Medium Increase<br> <input type="radio" name="question32" value="lowincrease">Low Increase<br> <input type="radio" name="question32" value="highdecrease">High Decrease<br> <input type="radio" name="question32" value="mediumdecrease">Medium Decrease<br> <input type="radio" name="question32" value="lowdecrease">Low Decrease</font></p> but it still doesn't send me the message and it still doesn't give me an error. Do I need to put all my code here? I'm not sure I've given enough for anyone to see the problem. Thank you so much for helping me. I really appreciate it. |
|
#4
|
|||
|
|||
|
When you look at the form, is there a radio button selected? And when you submit the form, on the action page if you do this:
<cfdump var="#form#"><cfabort> do you see that form field? |
|
#5
|
|||
|
|||
|
I'm sorry. I put the old html code. The first line reads this way.
<input type="radio" name="question32" value="highincrease" checked>High Increase<br> Yes, the first button is selected on the form. If you mean the .cfm page, I get no error when I look at it. I see the thank you page I created and it has no errors. However, I just discovered that I get an error on another form that's in the same folder. I see this when I look at that one: An error occurred while evaluating the expression: #Form.Name# Error near line 16, column 14. Could the form with the error have an effect on the other form in the same folder? The odd thing about the form that gives me the error is that it was working last week and it's not now. I don't get the error when I fill in the form and submit, but I don't get the e-mail message either. I'm sorry to be such a bother with this. I'm sure you are becoming frustrated with me and my lack of knowledge about it. I truly appreciate any help you are able to give. Thank you again for your time and your patience. |
|
#6
|
|||
|
|||
|
On the target page, the one that you want to call when the form is submitted, put this at the top of the page:
<cfdump var="#form#"><cfabort> You should see a dump of everything posted from the form. Do you see what you expect (what you submitted in the form)? |
|
#7
|
|||
|
|||
|
Yes. I also see all the form fields, plus a field for all the field names and the submit field. I only filled in two fields when I did this test and both of them had the information I put in them.
The target page is part of the cfm document. It's html code for a page that I have after the closing cfmail tag. I don't know if that is the problem or not. I have another simple form that I use on my contact page and I structured it the same way. It works just fine, but maybe this one is too complex for that? I also used the same thing for a survey form I did for a client using checkboxes and I have no problems with functionality on that one either. It works the same way as the form I use on my contact page. I hope I'm making sense. If you need to see all my code, I'd be happy to post it. Thanks again. |
|
#8
|
|||
|
|||
|
More importantly, do you see the value of the radio button that you are having problems with in the dump of the form scope? If you do then that means that something is wrong with your conditional logic to detect the value of the radio button.
|
|
#9
|
|||
|
|||
|
I'm sorry it took me so long to get back to this. I had some things come up that kept me from it.
Yes, I do see the value of the button I chose. My server only supports CF5. Is this tag set specifically for MX or should it also work with 5? I bought a book on CF5. I'm going to work with it and see if I can figure things out. I'll let you know if I find the answer in that. If anything occurs to you, I'd appreciate the help. Thanks again for taking the time to work with me. |
|
#10
|
||||
|
||||
|
if youre not getting an email make sure you have the right mail server name in and all of the details are correct such as the "from" ttributie must have a valid email. atleast on my server.
|
|
#11
|
|||
|
|||
|
If you can dump the form scope on the action page and you see the correct form field names and values, then the problem must be with the other logic on the action page or in your call to the mail server.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Radio Button Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|