Forums

Multipage checkboxes [UNSOLVABLE]

rjpilla 02 Jul, 2009
I have checkbox choices present on all pages of my multipage form. Problem I'm having is only the last page checkbox's are being saved. I made a simple 2 page form for testing and found again only the second page checkboxs are saved. Why is only the last page of checkbox's being saved. In the MYSQL table I changed the field names in incrementing order. On the form HTML I made the name correspond to the field name (EX. check0 - name in form code check0[]). I also made the id and label for= increment throughout all pages so there is no duplicate. How can I make the prior pages checkbox's save data?
rjpilla 02 Jul, 2009
Okay if I change the name of the checkbox so that its not an array it will save but then its acting like a radio button (Ex. check00[] changed to check00). So now the question becomes how do you get checkbox arrays to submit on each child form not just the last one?
rjpilla 02 Jul, 2009
I can't figure anything out here can use some help. The checkbox array on child forms (check0[]) is only being saved on the last child form. In otherwords, if you have 4 child pages of checkbox arrays only the checkbox's on the last page (page 4) will be saved to the database. If you take away the array (check0) the data on every page is saved. So this tells me i'm only getting the array's on the last child page saved to MYSQL.
rjpilla 03 Jul, 2009
Please at a stand still here. How can I get the checkbox's on all child pages saved to the MYSQL database? Only the last page gets saved. It appears upon clicking the submit button on each child page the arrays get cleared and are not transferred to the database. The last page gets saved however because no child page follows. Is some script needed to save the values on each child page?
rjpilla 04 Jul, 2009
With the debug turned on this is what I get when running a 2 page multiform with 1 checkbox on. step 1 which has 3 choices. So at the end of step 1 this is the debug info

1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [check0] => Array ( [0] => check 1 ) [button_1] => Submit [4873d3827d3983933d03b5d02a6c88aa] => 1 [1cf1] => cc3dca8f6e595e215de0743a5fee1cef [chronoformname] => testmother )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. Debug End

At the end of step 2 this is the debug info

1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [check0] => Array ( [0] => check 1 ) [button_1] => Submit [4873d3827d3983933d03b5d02a6c88aa] => 1 [1cf1] => cc3dca8f6e595e215de0743a5fee1cef [chronoformname] => testmother [check1] => Array ( [0] => check 1 [1] => check 2 ) [button_2] => Submit [cfformstep] => 1 )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. Debug End

Hope this helps.
rjpilla 04 Jul, 2009
Is there anybody out there?
rjpilla 04 Jul, 2009
I've tried setting email results to yes because I've seen this was a previous problem in the forums, however this did not work either. Is this a bug and is there some kind of workaround?
rjpilla 05 Jul, 2009
Not solved and running out of options to try. Please need help.
rjpilla 06 Jul, 2009
Please does anybody have the answer to how you save multipage checkbox data? As stated above only the last page gets saved.
GreyHead 06 Jul, 2009
Hi rjpilla,

Sorry, I've been on holiday - just getting back into the forums now.

I'm not completely clear what is happening here. It looks as though you are saving all the results into the same database table and that you have checkbox arrays in different sub-forms with the same name? In that case I woudl expect the later data to over-write the earlier data. If you want to save all the data then you either need to give the arrays different names/ids, or add some code to add the new data to the end of the data that is already saved. I'd guess that the first approach is probably what you need.

Bob
rjpilla 07 Jul, 2009
Code from 1st page,

<div class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label" style="width: 150px;">Click Me to Edit</label>
    <div class="float_left">
      <input value="check 1" title="" class="radio" id="check00" name="check0[]" type="checkbox" />
      <label for="check00" class="check_label">check 1</label>
      <br />
      
<input value="check 2" title="" class="radio" id="check01" name="check0[]" type="checkbox" />
      <label for="check01" class="check_label">check 2</label>
      <br />
      
<input value="check 3" title="" class="radio" id="check02" name="check0[]" type="checkbox" />
      <label for="check02" class="check_label">check 3</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear"> </div>
</div>

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


code from 2nd page


<div class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label" style="width: 150px;">Click Me to Edit</label>
    <div class="float_left">
      <input value="check 1" title="" class="radio" id="check04" name="check1[]" type="checkbox" />
      <label for="check04" class="check_label">check 1</label>
      <br />
      
<input value="check 2" title="" class="radio" id="check05" name="check1[]" type="checkbox" />
      <label for="check05" class="check_label">check 2</label>
      <br />
      
<input value="check 3" title="" class="radio" id="check06" name="check1[]" type="checkbox" />
      <label for="check06" class="check_label">check 3</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear"> </div>
</div>



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



as you can see name and id are different from each page. Can you reproduce this yourself?
Thx Bob I figured you were probably taking a break. This problem just has me really puzzled. As you can see from the code above I have a motherform, a test1 child page with default checkbox added ( has 3 selections ) and a second child page with 1 checkbox added with 3 selections.
GreyHead 07 Jul, 2009
Hi rjpilla,

There are a few things going on here, it may take a little while to untangle them all.

a) the main one I can see is that the URL you are submitting is
index.php?option=com_chronocontact&chronoformname=register=testing1&tmpl=component
which I think is missing a parameter name in &chronoformname=register=testing1&

b) the smallest one is that you have some stray code in the page showing /index.php?option=com_chronocontact&chronoformname=register&tmpl=component ...

c) There's also a JavaScript error being thrown

invalid assignment left-hand side
[Break on this error] myCal_d/m/Y = new Cale...Y' }, { classes: ['dashboard'] }); \n

that looks like some kind of ChronoForms problem.

d) You have JQuery loaded on the page as well as MooTools and this can cause problems with the '$' prefix (there is a fix in one of the forums). I'm testing with the &tmpl=component url to avoid any of these problems.

All that said, and JQuery conflicts aside, it should be possible to write some simpler code using the MooTools Ajax support and the ChronoForms Extra Code box. I'll take a look later today if I have time.

Bob
rjpilla 07 Jul, 2009
Thx Bob, to let u know i didn't write any code for this. I just simply put a single checkbox on 2 forms, and made a motherform. I then made a check0 and check1 field in the MySQL. I didn't want you to think I wrote any code here.
rjpilla 08 Jul, 2009
Just want to know Bob if you had a chance to take a look at this problem. I made another blank mother form with 2 child forms with 1 checkbox on each page and get the same result. I let the wizard make the database which it did do correctly. Still only the last page checkbox value is being retained. Does it have to do with array[0] since its retaining this name throughout the pages?
This topic is locked and no more replies can be posted.