Forums

My Radio and Check Buttons are not recognized by Email

Joyce Halsan 25 Sep, 2008
Hello, my second day, and I'm plodding through. I have now successfully made a simple form and have gotten to the email stage. I am having a difficult time getting my forms to show results in the email they are directed to. The radio buttons and check marks are not registering, but text fields are working. I used the form wizard to do the form below, thinking it might take care of the problem, but the same issue arises. I can't find anything on this issue, would appreciate some help. Code and email are below: Thanks in advance

Code:
<div class="form_item"><div class="form_element cf_heading"><h1 id="" class="cf_text">Membership application</h1></div><div class="clear"> </div></div><div class="form_item"><div class="form_element cf_radiobutton"><label class="cf_label">Please Choose</label><div class="float_left"><input value="New Membership" class="radio validate-one-required" id="New_Membership0" name="radio0" type="radio"><label for="New_Membership0" class="radio_label">New Membership</label><br><input value=" Renewal Dues" class="radio" id="_Renewal Dues0" name="radio0" type="radio"><label for="_Renewal Dues0" class="radio_label"> Renewal Dues</label><br></div></div><div class="clear"> </div></div><div class="form_item"><div class="form_element cf_radiobutton"><label class="cf_label">Dues Structure</label><div class="float_left"><input value="Full/Associate Annual" class="radio validate-one-required" id="Full/Associate_Annual2" name="radio2" type="radio"><label for="Full/Associate_Annual2" class="radio_label">Full/Associate Annual</label><br><input value=" Full/Associate Half Year" class="radio" id="_Full/Associate Half Year2" name="radio2" type="radio"><label for="_Full/Associate Half Year2" class="radio_label"> Full/Associate Half Year</label><br><input value=" Reduced Annual" class="radio" id="_Reduced Annual2" name="radio2" type="radio"><label for="_Reduced Annual2" class="radio_label"> Reduced Annual</label><br><input value=" Reduced Half Year" class="radio" id="_Reduced Half Year2" name="radio2" type="radio"><label for="_Reduced Half Year2" class="radio_label"> Reduced Half Year</label><br></div></div><div class="clear"> </div></div><div class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Optional Donation</label><div class="float_left"><input value="Scholarship" class="radio" id="Scholarship" name="Scholarship" type="checkbox"><label for="Scholarship" class="check_label">Scholarship</label><br><input value=" FAWCO Foundation" class="radio" id="_FAWCO Foundation" name="_FAWCO Foundation" type="checkbox"><label for="_FAWCO Foundation" class="check_label"> FAWCO Foundation</label><br><input value=" AWCCS Charity" class="radio" id="_AWCCS Charity" name="_AWCCS Charity" type="checkbox"><label for="_AWCCS Charity" class="check_label"> AWCCS Charity</label><br></div></div><div class="clear"> </div></div><div class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Total Amount to Pay</label><input class="cf_inputbox required validate-number validate-currency-dollar" maxlength="10" size="10" id="text_4" name="text_4" type="text"></div><div class="clear"> </div></div><div class="form_item"><div class="form_element cf_radiobutton"><label class="cf_label">Method of Payment</label><div class="float_left"><input value="Cheque" class="radio validate-one-required" id="Cheque6" name="radio6" type="radio"><label for="Cheque6" class="radio_label">Cheque</label><br><input value=" PayPal" class="radio" id="_PayPal6" name="radio6" type="radio"><label for="_PayPal6" class="radio_label"> PayPal</label><br><input value=" Cash" class="radio" id="_Cash6" name="radio6" type="radio"><label for="_Cash6" class="radio_label"> Cash</label><br></div></div><div class="clear"> </div></div><div class="form_item"><div class="form_element cf_button"><input name="submit" value="Submit" type="submit"></div><div class="clear"> </div></div>


This is what comes through on the email:

"Membership application

Please Choose
New MembershipNew Membership
New Membership Renewal Dues
Dues Structure
Full/Associate AnnualFull/Associate Annual
Full/Associate Annual Full/Associate Half Year
Full/Associate Annual Reduced Annual
Full/Associate Annual Reduced Half Year
Optional Donation
ScholarshipScholarship
FAWCO Foundation
AWCCS Charity
Total Amount to Pay34
Method of Payment
ChequeCheque
Cheque PayPal
Cheque Cash


Submitted by 92.235.164.220"
Max_admin 25 Sep, 2008
Hi Joyce,

the wizard takes your hand to setup a form and an email template, however the generated email template may not be the best for your needs and you should edit it, go the email templates tab and edit the email template to be just as you need it, for example, remove the labels for the last 3 radios so only radios which got checked will appear in the email!

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Joyce Halsan 26 Sep, 2008
Thanks very Much, I did this and it took care of the problem. I now understand a great deal more about the forms "world" The only thing I couldn't get it to identify were check boxes when more than one option could be checked. I found some information on the forum "settiing checkbox array items", but I'm sorry to say I'm just not experienced enough to understand where the code discussed could be placed. Is there an easier solution to my problem, or should I just keep working on trial and error?

I very much appreciate all of the help, I feel I am almost to the end, and you've been brilliant to help me along. I've looked at all the tutorials, but I wondered is there anywhere a step by step guide that might answer these questions? Thanks again, Joyce
Max_admin 26 Sep, 2008
Hi Joyce, just let me understand what you are trying to achieve now and I will help for sure!

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Joyce Halsan 27 Sep, 2008
Okay. I have a form where I wish people to check more than one box. Then I would like to get the information via email on the template.

Here is the code for the check boxes:
<label><font size="2" color="#006699">If yes, in which position(s) are you most interested?</font></label><br />
<input type="checkbox" name="checkbox_3" value="President " /> President </font>
<input type="checkbox" name="checkbox_3" value="Vice President" /><font size="2" color="#006699"> Vice President </font><input type="checkbox" name="checkbox_3" value="Secretary" /><font size="2" color="#006699"> Secretary</font>
<input type="checkbox" name="checkbox_3" value="Treasurer" /><font size="2" color="#006699"> Treasurer </font>
<input type="checkbox" name="checkbox_3" value="Membership" /><font size="2" color="#006699"> Membership<br /></font><input type="checkbox" name="checkbox_3" value="Social Chair" /><font size="2" color="#006699"> Social Chair </font>
<input type="checkbox" name="checkbox_3" value="Charity Fund" /><font size="2" color="#006699"> Charity Fund </font>
<input type="checkbox" name="checkbox_3" value="Newsletter Editor" /><font size="2" color="#006699"> Newsletter Editor </font><input type="checkbox" name="checkbox_3" value="FAWCO Rep" /><font size="2" color="#006699"> FAWCO Rep. <br /></font>
<input type="checkbox" name="checkbox_3" value="Glasgow Rep" /><font size="2" color="#006699"> Glasgow Rep. </font>
<input type="checkbox" name="checkbox_3" value="Website" /><font size="2" color="#006699"> Website </font>
<input type="checkbox" name="checkbox_3" value="Parliamentarian" />
<font size="2" color="#006699">Parliamentarian</font></p></div>

For the email template, for this particular entry I put: Position(s): {checkbox_3}

What I need in the Email template is code that allows me to see all of the options that have been checked (since they can check more than one) and what I get is only one of the options checked. This is true for all of my checkbox options, and I would love to get more than one answer for these particular issues. The radio options are fine, since only one is chosen.

Hopefully I made this clear? Thanks in advance. Joyce
GreyHead 27 Sep, 2008
Hi Joyce,

All the checkboxes have the same name - so only the last one is returned. You have to give them different names, the simplest way of handling this is to use an array name - checkbox_3[] - you will then get an array returned in $_POST like 'President', , 'Secretary', . . .

You may need to unpack the array into a comma separated string to use it by using the explode() function. ChronoForms will do this automatically for the database save if it sees an array name when the table is created.

Bob
Joyce Halsan 28 Sep, 2008
Thanks for trying to help. I'm afraid I couldn't get that checkbox group to work any way I tried it, so I used the Form Wizard to do it with the thought that it might automatically code it properly. Unfortunately, I am still getting all of the options on the returned email rather than only the one's checked.

Here's the code for the sample form:
<div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Name</label><input class="cf_inputbox required validate-alpha" maxlength="150" size="30" id="text_0" name="text_0" type="text"></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">email</label><input class="cf_inputbox required validate-email" maxlength="150" size="30" id="text_1" name="text_1" type="text"></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_text"><span class="cf_text">Board Positions you are interested in:</span></div><div class="clear"> </div></div>

<div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Choose Any:</label><div class="float_left">

<input value="President" class="radio" id="President" name="President" type="checkbox"><label for="President" class="check_label">President</label><br>
<input value=" VicePresident" class="radio" id="_VicePresident" name="_VicePresident" type="checkbox"><label for="_VicePresident" class="check_label"> VicePresident</label><br>
<input value=" Secretary" class="radio" id="_Secretary" name="_Secretary" type="checkbox"><label for="_Secretary" class="check_label"> Secretary</label><br>
<input value=" Treasurer" class="radio" id="_Treasurer" name="_Treasurer" type="checkbox"><label for="_Treasurer" class="check_label"> Treasurer</label><br>
<input value=" Membership Chair" class="radio" id="_Membership Chair" name="_Membership Chair" type="checkbox"><label for="_Membership Chair" class="check_label"> Membership Chair</label><br>
<input value=" Social Chair" class="radio" id="_Social Chair" name="_Social Chair" type="checkbox"><label for="_Social Chair" class="check_label"> Social Chair</label><br>
<input value=" Charity Chair" class="radio" id="_Charity Chair" name="_Charity Chair" type="checkbox"><label for="_Charity Chair" class="check_label"> Charity Chair</label><br>
<input value="Parliamentarian" class="radio" id="Parliamentarian" name="Parliamentarian" type="checkbox"><label for="Parliamentarian" class="check_label">Parliamentarian</label><br>
<input value=" FAWCO Representative" class="radio" id="_FAWCO Representative" name="_FAWCO Representative" type="checkbox"><label for="_FAWCO Representative" class="check_label"> FAWCO Representative</label><br>
<input value=" Newsletter editor" class="radio" id="_Newsletter editor" name="_Newsletter editor" type="checkbox"><label for="_Newsletter editor" class="check_label"> Newsletter Editor</label><br>
<input value=" PR/Adverising" class="radio" id="_PR/Adverising" name="_PR/Adverising" type="checkbox"><label for="_PR/Adverising" class="check_label"> PR/Adverising</label><br>
<input value=" Glasgow Representative" class="radio" id="_Glasgow Representative" name="_Glasgow Representative" type="checkbox"><label for="_Glasgow Representative" class="check_label"> Glasgow Representative</label><br>
<input value=" Website Manager" class="radio" id="_Website Manager" name="_Website Manager" type="checkbox"><label for="_Website Manager" class="check_label"> Website Manager</label><br></div></div>

<div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_button"><input value="Submit" name="undefined" type="submit"></div><div class="clear"> </div></div>

As I look at this html I don't see any place to add the brakets [] which identify it as an array. I tried to add it at the end of each 'type="checkbox[]"' but only got the title in the checkbox when it appears on the form. I also tried to add the html language for the array that I found elsewhere in the forum, but couldn't get it to work for me. There are many things I don't know.
1. Where in the form code does one put the html language that identifies this as an array?
2. Could I please get an example of the html code that would work with the above checkbox sample?
2. How does the email template look in asking for the response?

I'm sorry if this is asking for too much, but I've spent hours on this and can't really afford the time any longer. I can change the form to not use checkboxes, but It really is the best way to get the information. Thanks again, and sorry for the lack of knowledge.
Joyce
3.
GreyHead 28 Sep, 2008
Hi Joyce,

The [] goes in the name like name='checkbox_3[]' See FAQ 19 here.

If you want to email me admin access at the address in my sig then I can take a look for you.

Bob
GreyHead 28 Sep, 2008
Hi Joyce,

Here's your Form HTML with checkbox[] names
    <div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Name</label><input class="cf_inputbox required validate-alpha" maxlength="150" size="30" id="text_0" name="text_0" type="text"></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">email</label><input class="cf_inputbox required validate-email" maxlength="150" size="30" id="text_1" name="text_1" type="text"></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_text"><span class="cf_text">Board Positions you are interested in:</span></div><div class="clear"> </div></div>

    <div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Choose Any:</label><div class="float_left">

    <input value="President" class="radio" id="President" name="checkbox[]" type="checkbox"><label for="President" class="check_label">President</label><br>
    <input value=" VicePresident" class="radio" id="_VicePresident" name="checkbox[]" type="checkbox"><label for="_VicePresident" class="check_label"> VicePresident</label><br>
    <input value=" Secretary" class="radio" id="_Secretary" name="checkbox[]" type="checkbox"><label for="_Secretary" class="check_label"> Secretary</label><br>
    <input value=" Treasurer" class="radio" id="_Treasurer" name="checkbox[]" type="checkbox"><label for="_Treasurer" class="check_label"> Treasurer</label><br>
    <input value=" Membership Chair" class="radio" id="_Membership Chair" name="checkbox[]" type="checkbox"><label for="_Membership Chair" class="check_label"> Membership Chair</label><br>
    <input value=" Social Chair" class="radio" id="_Social Chair" name="checkbox[]" type="checkbox"><label for="_Social Chair" class="check_label"> Social Chair</label><br>
    <input value=" Charity Chair" class="radio" id="_Charity Chair" name="checkbox[]" type="checkbox"><label for="_Charity Chair" class="check_label"> Charity Chair</label><br>
    <input value="Parliamentarian" class="radio" id="Parliamentarian" name="checkbox[]" type="checkbox"><label for="Parliamentarian" class="check_label">Parliamentarian</label><br>
    <input value=" FAWCO Representative" class="radio" id="_FAWCO Representative" name="checkbox[]" type="checkbox"><label for="_FAWCO Representative" class="check_label"> FAWCO Representative</label><br>
    <input value=" Newsletter editor" class="radio" id="_Newsletter editor" name="checkbox[]" type="checkbox"><label for="_Newsletter editor" class="check_label"> Newsletter Editor</label><br>
    <input value=" PR/Adverising" class="radio" id="_PR/Adverising" name="checkbox[]" type="checkbox"><label for="_PR/Adverising" class="check_label"> PR/Adverising</label><br>
    <input value=" Glasgow Representative" class="radio" id="_Glasgow Representative" name="checkbox[]" type="checkbox"><label for="_Glasgow Representative" class="check_label"> Glasgow Representative</label><br>
    <input value=" Website Manager" class="radio" id="_Website Manager" name="checkbox[]" type="checkbox"><label for="_Website Manager" class="check_label"> Website Manager</label><br></div></div>

    <div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_button"><input value="Submit" name="undefined" type="submit"></div><div class="clear"> </div></div>
The resulting email has a list of the values of the checked boxes:
[attachment=0]28-09-2008 17-41-54.png[/attachment]

Bob
Joyce Halsan 29 Sep, 2008
Success! For me a picture is worth a thousand words. It is actually easier than I would have thought, I was looking for much more complex html. Thank you, thank you, thank you. I can now publish my form. I so appreciate the brilliant and quick feedback, I'll tell the world.
Cheers,
Joyce
This topic is locked and no more replies can be posted.