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?
#851
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? 1 Year ago Karma: 1  
GreyHead wrote:
QUOTE:
Hi Suckerhead,

I think I have this working smoothly (fingers crossed). There are several places where you need to deal with the array that is returned by checkbox inputs. The changes are pretty simple and are along the lines described here but rather than try and explain them I've attached a couple of modified files for ChronoForms 2.1.4 - chronocontact.php and admin.chronocontact.php Make sure that you have copies of the distribution files then overwrite your installation with these two.

These files should fix the following problems:

+ Checkbox inputs only show the final entry
+ Field name shown as 'name[]' on Create table
+ Incomplete SQL error on Create table
+ Show checkbox arrays as comma separated lists in e-mails and database tables.

Please let me know if you have any problems and I'll look again - sorry this has taken so long, it's been a busy week.

Bob

[file name=chronocontact_checkbox.zip size=6927]http://www.chronoengine.com/components/com_fireboard/uploaded/files/chronocontact_checkbox.zip[/file][/quote]

Hi bob,

thanks for what you have done
but still not working in here after i replace the adHi Suckerhead,

I think I have this working smoothly (fingers crossed). There are several places where you need to deal with the array that is returned by checkbox inputs. The changes are pretty simple and are along the lines described here but rather than try and explain them I've attached a couple of modified files for ChronoForms 2.1.4 - chronocontact.php and admin.chronocontact.php Make sure that you have copies of the distribution files then overwrite your installation with these two.

These files should fix the following problems:

+ Checkbox inputs only show the final entry
+ Field name shown as 'name[]' on Create table
+ Incomplete SQL error on Create table
+ Show checkbox arrays as comma separated lists in e-mails and database tables.

Please let me know if you have any problems and I'll look again - sorry this has taken so long, it's been a busy week.

Bob

File Attachment:
File Name: chronocontact_checkbox.zip
File Size: 6927


Hi bob,

thanks for what you have done
but still not working in here after i replace the admin.chronocontact.php and chronocontact.php.


here's my step (correct me if i'm wrong)
#1 create table, and add '[]' on the checkbox, eg: name"abc[]"

#2a create table--- success
b try the form --- the result on the database is "Array" not the value.

#3a add code onsubmit - beforesending email
[code]
<?php
if ( is_array($_POST[abc]) ) {
$_POST[abc] = imlockquote>

Hi bob,

thanks for what you have done
but still not working in here after i replace the admin.chronocontact.php and chronocontact.php.


here's my step (correct me if i'm wrong)
#1 create table, and add '[]' on the checkbox, eg: name"abclockquote>

Hi bob,

thanks for what you have done
but still not working in here after i replace the admin.chronocontact.php and chronocontact.php.


here's my step (correct me if i'm wrong)
#1 create table, and add '[]' on the checkbox, eg: name"abc[]"

#2a create table--- success
b try the form --- the result on the database is "Array" not the value.

#3a add code onsubmit - beforesending email
[code]
<?php
if ( is_array($_POST[abc]) ) {
$_POST[abc] = imlockquote>

Hi bob,

thanks for what you have done
but still not working in here after i replace the admin.chronocontact.php and chronocontact.php.


here's my step (correct me if i'm wrong)
#1 create table, and add '[]' on the checkbox, eg: name"abc[]"

#2a create table--- success
b try the form --- the result on the database is "Array" not the value.

#3a add code onsubmit - beforesending email
Code:

<?php if ( is_array($_POST[abc]) ) { $_POST[abc] = implode(',', $_POST[abc]); } ?>
#3b try the form - same result. can you give me more detail. - sample form - code to put on the onsubmit code before sending - or i miss something to put on? thanks again
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#852
GreyHead (Admin)
Admin
Posts: 2801
graph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 1 Year ago Karma: 59  
Hi Suckerhead,

Ah! I may have found it - please test with 'E-mail the results' set to 'Yes' (I know you don't want to do this but that's the one difference between my form and yours).

Also leave out the code in #3a below as that should already be in the amended files.

If this works then I'll make a change to the files so that it works with or without the e-mail option.

Bob
 
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.
#855
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? 1 Year ago Karma: 1  
GreyHead wrote:
QUOTE:
Hi Suckerhead,

Ah! I may have found it - please test with 'E-mail the results' set to 'Yes' (I know you don't want to do this but that's the one difference between my form and yours).

Also leave out the code in #3a below as that should already be in the amended files.

If this works then I'll make a change to the files so that it works with or without the e-mail option.

Bob


Bob,
you're my man.... Finally it works.. you're awesome man...
I'm waiting your correction file so it works with or without email option. (please attach the file )

Thanks bro..
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#862
GreyHead (Admin)
Admin
Posts: 2801
graph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 1 Year ago Karma: 59  
Hi suckerhead,

Try this version. Both files are included in case anyone else tries it but only chronocontact.php is changed from the previous version.

This should work with any single dimension array in a form - that's what you are using. However, it won't work for multiple dimension arrays e.g. if you name all your form fields "form['some_name']" and among them have some checkboxes with names like "form['some_array[]']" That would need a further mod.

Forms like this are pretty rare - but sometimes it can be convenient to sweep up form values in an array for further processing.

Bob
File Attachment:
File Name: chronocontact_checkbox-cf27fcaa41b8fe861c763c88700b3d5a.zip
File Size: 6992
<br><br>Post edited by: GreyHead, at: 2007/06/29 16:02
 
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.
#898
suckerhead (User)
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
multiple checkbox [SOLVED] 1 Year ago Karma: 1  
GreyHead wrote:
QUOTE:
Hi suckerhead,

Try this version. Both files are included in case anyone else tries it but only chronocontact.php is changed from the previous version.

This should work with any single dimension array in a form - that's what you are using. However, it won't work for multiple dimension arrays e.g. if you name all your form fields "form['some_name']" and among them have some checkboxes with names like "form['some_array[]']" That would need a further mod.

Forms like this are pretty rare - but sometimes it can be convenient to sweep up form values in an array for further processing.

Bob
File Attachment:
File Name: chronocontact_checkbox-cf27fcaa41b8fe861c763c88700b3d5a.zip
File Size: 6992
<br><br>Post edited by: GreyHead, at: 2007/06/29 16:02


HUURAAAYYY......
Problem solved...
thanks Bob for the support
and thanks to the great extention ....

please include this on the next update version...

thanks again,
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#7765
nosins (User)
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
Re:multiple checkbox , only record last answer? 2 Months, 1 Week ago Karma: 0  
Hey Bob,

I'm having difficulty with only the last checkbox (sharing names with others) being submitted ...so I tried these files, but it causes an error on my site ...the form doesn't display at all. I'm assuming that it's because the version of chronoforms has changed since these files were created. I'm using version: 2.5 J1.5 RC3.1

Any thoughts?

Thanks,

nick.
 
Report to moderator   Logged Logged  
  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