Hi,
to start we have three dropdown boxes. When the first has a selection then the second got filled. In the event i'm using the vales found in $form-data['vb1'] Now when we select something in the second box the event to fill the third box get fired.
Options should be loaded depending on the values selected in the previous two boxes. However it seems that i can't access the $form-data['vb1'] value. Only the $form->data['vb2'] is available.
So i need to have access to all form values in the php code launched from the event. Tryed already to put a data to session before the custom code, but i don't seems to have access.
The only $form-data field that seems to be available in the ajax event is the sourceid value. No others fields are available.
How can i solve this? Any ideas?
to start we have three dropdown boxes. When the first has a selection then the second got filled. In the event i'm using the vales found in $form-data['vb1'] Now when we select something in the second box the event to fill the third box get fired.
Options should be loaded depending on the values selected in the previous two boxes. However it seems that i can't access the $form-data['vb1'] value. Only the $form->data['vb2'] is available.
So i need to have access to all form values in the php code launched from the event. Tryed already to put a data to session before the custom code, but i don't seems to have access.
The only $form-data field that seems to be available in the ajax event is the sourceid value. No others fields are available.
How can i solve this? Any ideas?
Hi rodiusd,
You need to include both values in the data that is sent back to the Ajax event. You can add them to the URL or the 'data' part of the PHP. I think that you probably need to hand-code the second Ajax call to get this to work OK.
Here's an example from a client form
There are a couple of fixed values in the URL and a couple more variable values in the JSON array at the end.
Bob
You need to include both values in the data that is sent back to the Ajax event. You can add them to the URL or the 'data' part of the PHP. I think that you probably need to hand-code the second Ajax call to get this to work OK.
Here's an example from a client form
hose_req = new Request.JSON({
url: 'index.php?option=com_chronoforms&chronoform=hose_configurator_a&event=ajax_a&r=hose',
method: 'get',
onRequest: function() {
// . . .
},
onSuccess: function(resp) {
// . . .
},
onFailure: function() {
// . . .
}
}).post({'gas': gas.value, 'size': size.value});
There are a couple of fixed values in the URL and a couple more variable values in the JSON array at the end.
Bob
This topic is locked and no more replies can be posted.