ChronoEngine Forums
Welcome, Guest
Please Login or Register.    Lost Password?
multiple checkbox , only record last answer? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: multiple checkbox , only record last answer?
#754
suckerhead (User)
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
multiple checkbox , only record last answer? 10 Months, 3 Weeks ago Karma: 1  
i have a form with checkbox (can select multiple answer)

but the problem is... if i select multiple answer, only the last answer record at the table.

please help.

thanks.

File Attachment:
File Name: check.txt
File Size: 1147
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#756
admin (Admin)
Admin
Posts: 1514
graphgraph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 10 Months, 3 Weeks ago Karma: 22  
Right, because first you need to name your boxes as music[] and not only music!!

please try this and let me know the effect on thight, because first you need to name your boxes as music[] and not only music!!

please try this and let me know the effect on the email results and the database record

Cheers

max
 
Report to moderator   Logged Logged  
 
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you need Registration or profile forms and more then you can try ChronoForms V2.3.8 or up with the new plugins
If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#757
suckerhead (User)
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 10 Months, 3 Weeks ago Karma: 1  
you meant i have to name all the check box musicou meant i have to name all the check box music[]?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#758
suckerhead (User)
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 10 Months, 3 Weeks ago Karma: 1  
suckerhead wrote:
QUOTE:
you meant i have to name all the check box music[]? [/quote]

still error

if i sellect jazz, rock and ballad, i want the result on the database (table music) is jazz, rock, ballad

please see attached my file?

can you please edit for me? [file name=check-9e339f1a8c887e6e42ab798963237fe4.txt size=1112]http://www.chronoengine.com/components/com_fireboard/uploaded/files/cyou meant i have to name all the check box music[]?


still error

if i sellect jazz, rock and ballad, i want the result on the database (table music) is jazz, rock, ballad

please see attached my file?

can you please edit for me?
File Attachment:
File Name: check-9e339f1a8c887e6e42ab798963237fe4.txt
File Size: 1112
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/14 06:20 By GreyHead.
  The administrator has disabled public write access.
#759
GreyHead (Admin)
Admin
Posts: 2191
graph
User Online Now Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 10 Months, 3 Weeks ago Karma: 44  
Hi suckerhead,

Yes, that's good for the 'name' attributes (technically the 'id' attributes don't need the brackets and they should all be unique e.g. id='music_jazz' or id='music_1' but it probably won't make any real difference unless you use the ids in css or javascript).

I think that you now need to make some code hacks to have array fields work properly in ChronoForms v2.1:

In the Form Code tab paste in the 'On Submit code - before sending email:' box.
Code:

<?php if ( is_array($_POST[field_name]) ) { $_POST[field_name] = implode(',', $_POST[field_name]); } ?>
If you use templates, then to get them to work correctly open up chronocontact.php and go to line 143 and insert a new line after it .
Code:

$name = preg_replace('/name=("|\')/', '', $new_match2); $name = str_replace('[]', '', $name); /* <- insert this line */ $emailbodytemplate = $rows[0]->emailtemplate;
Bob

Post edited by: GreyHead, at: 2007/06/25 15:21
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#760
admin (Admin)
Admin
Posts: 1514
graphgraph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 10 Months, 3 Weeks ago Karma: 22  
so, how is it after applying Bob's hack?

Cheers

Max
 
Report to moderator   Logged Logged  
 
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you need Registration or profile forms and more then you can try ChronoForms V2.3.8 or up with the new plugins
If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials