I am writing a form that has some number of categories on a first form, each with a frequency question. That form is submitting to a second form with a group of additional questions based on the answers to the frequency question. My thought was to dynamically feed in the category as an array and then make it associative based on the various attributes of the category. For example, on the first form
Assuming there are multiple categories on the first and the second forms, how do I access the specific values for each element? I know I can use foreach to loop through the $_POST array. I just can't seem to access the next level associative array. Any code examples would be appreciated.
TIA, Doug.
name="category['frequency']"
. This info gets added to a hidden field on the second form and combined with a bunch of new elements with attributes such as name="category['month']"
and name="category['amount']"
.Assuming there are multiple categories on the first and the second forms, how do I access the specific values for each element? I know I can use foreach to loop through the $_POST array. I just can't seem to access the next level associative array. Any code examples would be appreciated.
TIA, Doug.
Hi Doug,
Please will you turn on Debug for the second form and post the resulting $_POST array here so that we can see exactly what is being returned?
Bob
Please will you turn on Debug for the second form and post the resulting $_POST array here so that we can see exactly what is being returned?
Bob
Bob,
I am actually going to hand code the backside of form two as it will be selecting the group of questions based on the first form. My problem is that my switch is expecting a certain frequency (never, once, monthly, or other). However, print_r of the $_POST array yields the following code
Hope you can help.
I am actually going to hand code the backside of form two as it will be selecting the group of questions based on the first form. My problem is that my switch is expecting a certain frequency (never, once, monthly, or other). However, print_r of the $_POST array yields the following code
Array ( [car_payment] => Array ( [frequency] => once ) [Submit] => submit )
My switch needs to read that frequency value ("once" in this particular example) but I don't know how to get to it.Hope you can help.
Hi Doug,
Try
Bob
Try
<?php
$car_payment = JRequest::getVar('car_payment', '', 'post');
$frequency = $car_payment['frequency'];
. . .
Bob
THANKS! I will give it a try. I have been testing a simple form in raw php on localhost. I am going to start moving it all into ChronoForms on the actual site later this afternoon. If you don't mind a really stupid question...does the JRequest::getVar() actually get the whole car_payment array allowing me to access any and/or all associative values as I need?
I am trying to do the same thing, but load the var into a session. If I were to hard code:
it will pass from Form 1 and I have made it place the value into another text box on forum 2.
But I am trying to make it so whatever the user enters into the text box, will go over:
This is what the debug is giving me:
So I am sure im doing something wrong, as to why its not passing over the value, just not sure what ?
Any ideas ??
$businessname = "TheName"
it will pass from Form 1 and I have made it place the value into another text box on forum 2.
But I am trying to make it so whatever the user enters into the text box, will go over:
<?php
$session =& JFactory::getSession();
$businessname = JRequest::getVar('business_name','','post');
$session->set('businessname', $businessname);
?>
This is what the debug is giving me:
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 ( [business_name] => 4444444 [hidden_3] => [button_2] => Contine [6398c8b53cd4ebbde2581158afc04093] => 1 [1cf1] => 46ba27ecac4d58d79118026313e41800 [chronoformname] => Form_Start )
6.$_FILES Array: Array ( )
7.Form passed the plugins step (if enabled) OK
8.Debug End
9.Redirect link set, click to test
So I am sure im doing something wrong, as to why its not passing over the value, just not sure what ?
Any ideas ??
When I first saw this tool, I thought it looked fantastic, installed it, had a play, and fabulous, it looked good, actioned it's requirements seamlessly. Read of the speedy tech help and thought, I am going to buy this right now!
Then I remember all the other modules I have purchased, and the promise of good support, but how I had been let down, so I had a client that I need to adapted to, and thought I will post before spending their money, to see if the above issue could be resolved.
I have posted 3 times, explaining, though maybe not very well, and showing my issue over the past 3 days. How many replies have I had.... Z E R O !
I need help with one element, which to my client is an important one, and I am more than ready to learn, and here I ask for help, 3 times, but nothing. I PM because I have a deadline.... nothing...
Last thing I can afford to is alienate myself from the forums community or it's admin, but how is this speedy support? I am posting in the wrong place, is there another way, do I need to pay before I get the speedy support? Can anyone enlighten me on this?
Then I remember all the other modules I have purchased, and the promise of good support, but how I had been let down, so I had a client that I need to adapted to, and thought I will post before spending their money, to see if the above issue could be resolved.
I have posted 3 times, explaining, though maybe not very well, and showing my issue over the past 3 days. How many replies have I had.... Z E R O !
I need help with one element, which to my client is an important one, and I am more than ready to learn, and here I ask for help, 3 times, but nothing. I PM because I have a deadline.... nothing...
Last thing I can afford to is alienate myself from the forums community or it's admin, but how is this speedy support? I am posting in the wrong place, is there another way, do I need to pay before I get the speedy support? Can anyone enlighten me on this?
Hi Addy,
Mainly because when I read your psot I don't really understand what you are asking so leave it to come back to later.
You don't say where you are putting the code or where you are testing to see if it is in the session data or not. And I'm not clear how the two forms are linked together.
Bob
PS It makes no difference if you have subscribed or not - I can’t tell when I post here. Posting short clear questions in the forum is the best way to get answers. PMs and emails get answered after forum posts (unless there is a good reason for a private message). Double posting tends not to help.
Mainly because when I read your psot I don't really understand what you are asking so leave it to come back to later.
You don't say where you are putting the code or where you are testing to see if it is in the session data or not. And I'm not clear how the two forms are linked together.
Bob
PS It makes no difference if you have subscribed or not - I can’t tell when I post here. Posting short clear questions in the forum is the best way to get answers. PMs and emails get answered after forum posts (unless there is a good reason for a private message). Double posting tends not to help.
Hi Addy,
Regarding the code you've posted in this thread:
The code for storing the data in the session storage looks well enough. ChronoForms, however, is unaware of this action, and it is your task to later retrieve that stored data for whatever actions it is needed. As such, you will not see any traces of it in the standard Debug output.
The MultiPage CFPlugin (if you are using this, I see you are talking of two different forms) does also use the Session storage inbetween form steps, but uses it's own namespace.
Regarding your other threads; I understand you had one of them solved within an hour yourself (Error on Saving Data). As for your other thread, I've just gotten 'round to that one.
/Fredrik
Regarding the code you've posted in this thread:
The code for storing the data in the session storage looks well enough. ChronoForms, however, is unaware of this action, and it is your task to later retrieve that stored data for whatever actions it is needed. As such, you will not see any traces of it in the standard Debug output.
The MultiPage CFPlugin (if you are using this, I see you are talking of two different forms) does also use the Session storage inbetween form steps, but uses it's own namespace.
Regarding your other threads; I understand you had one of them solved within an hour yourself (Error on Saving Data). As for your other thread, I've just gotten 'round to that one.
/Fredrik
This topic is locked and no more replies can be posted.