Hello,
first I want congratulate for this Form-Module!
I choosed this Module for a try, to get mulltipaged formulars with external php-code to work in joomla.
I got my multipage formular very quickly and easy with the tutorials and I think I understand the using of events. But now I want to integrate php-code to make some checks doing some http-requests with the formular-data and then to transmit the results back for user-verification to the form. The user should then submit this form and the form-data will be updated by php-code to a external crm-system.
I already integrated some classes which I need for http-requests and the transmission to the crm-system in joomla.
But now, I'm not sure how to get access to this classes.
Has anybody experience in it?
Could you give me a hint how to access the class functions?
I would appreciate to get help.
Thanks in advance!
LL
Update:
I'll try to use the joomla way ;-) If I have problems, I will come back.
No problem with accessing in joomla way:-)
But now I need som explanations to the Custom Event Switcher, how can I us it in conjunction with my php code? Has anybody an example?
first I want congratulate for this Form-Module!
I choosed this Module for a try, to get mulltipaged formulars with external php-code to work in joomla.
I got my multipage formular very quickly and easy with the tutorials and I think I understand the using of events. But now I want to integrate php-code to make some checks doing some http-requests with the formular-data and then to transmit the results back for user-verification to the form. The user should then submit this form and the form-data will be updated by php-code to a external crm-system.
I already integrated some classes which I need for http-requests and the transmission to the crm-system in joomla.
But now, I'm not sure how to get access to this classes.
Has anybody experience in it?
Could you give me a hint how to access the class functions?
I would appreciate to get help.
Thanks in advance!
LL
Update:
I'll try to use the joomla way ;-) If I have problems, I will come back.
No problem with accessing in joomla way:-)
But now I need som explanations to the Custom Event Switcher, how can I us it in conjunction with my php code? Has anybody an example?
Hi Louisleon,
You can include classes using a Custom Code action. There is also a built-in HTTP Request action though I haven't used it.
Bob
You can include classes using a Custom Code action. There is also a built-in HTTP Request action though I haven't used it.
Bob
Hi Bob!
Thanks for your answer, I already got it working.
I try to use the custom event switcher now, because I have to manage some states.
Do you have a small example for me?
Thanks in advance!
LL
Update:
I think it could be similiar to Custom ServerSide Validation.
I tried this ServerSide Validation:
But I get this error message:
Can anyone explain why?
And what to do in the events "OnFail/OnSuccess"?
Can I combine standard validation and Custom Server Site Validation?
Thanks for your answer, I already got it working.
I try to use the custom event switcher now, because I have to manage some states.
Do you have a small example for me?
Thanks in advance!
LL
Update:
I think it could be similiar to Custom ServerSide Validation.
I tried this ServerSide Validation:
<?php
require_once (JPATH_THEMES."/austria/functionlib.php");
if (isValidEmail($form->data['myemail'], false)){
form->validation_errors['myemail'] == 'E-Mail is wrong';
return false;
}
else{
return true;
}
?>
But I get this error message:
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /var/www/virtual/mydomain/htdocs/administrator/components/com_chronoforms/form_actions/custom_serverside_validation/custom_serverside_validation.php(19) : eval()'d code on line 4
Can anyone explain why?
And what to do in the events "OnFail/OnSuccess"?
Can I combine standard validation and Custom Server Site Validation?
Hi LL,
The error is because this line is missing the $ at the beginning
Please see this FAQ for more info on Custom Serverside validation.
Yes you can use both Auto and Custom Serverside Validation. You need to add some custom code if you want to make sure that both on the same submit though. Please see this FAQ.
Bob
The error is because this line is missing the $ at the beginning
$form->validation_errors['myemail'] . . .
Please see this FAQ for more info on Custom Serverside validation.
Yes you can use both Auto and Custom Serverside Validation. You need to add some custom code if you want to make sure that both on the same submit though. Please see this FAQ.
Bob
You are right ;-)
Everything works fine!
Just a last Question.
Is it necessary that the form have to be shown to update form fields after server side validation?
I'm checking for example the street-name, found that the input typing is different and want to assign the right typing I got from my research.
But "$form->data['sstreet']" keep his value.
(I know I already read about it, but I didn't find it anymore)
How can I change the original form-field value without showing the form anymore?
It happens at form end before saving to crm-system.
I need this correct street name for another research in custom code on submit.
Thanks in advance!
Everything works fine!
Just a last Question.
Is it necessary that the form have to be shown to update form fields after server side validation?
I'm checking for example the street-name, found that the input typing is different and want to assign the right typing I got from my research.
if ($form->data['sstreet'] !== $mystreet){
$i = similar_text($form->data['sstreet'], $mystreet, $percent);
if ($percent < 70){
$form->validation_errors['sstreet'] = 'Street not valid';
return false;
}
else
{
$form->data['sstreet'] = $mystreet;
}
}
But "$form->data['sstreet']" keep his value.
(I know I already read about it, but I didn't find it anymore)
How can I change the original form-field value without showing the form anymore?
It happens at form end before saving to crm-system.
I need this correct street name for another research in custom code on submit.
Thanks in advance!
Hi LL,
You don't need to redisplay the form at all, If you can correct the data just update the $form->data[] entry as you have in the code snippet.
Bob
You don't need to redisplay the form at all, If you can correct the data just update the $form->data[] entry as you have in the code snippet.
Bob
But "$form->data['sstreet']" keep his value.
That's my live-code, it isn't working.
The field keep it's value, I don't know why.
Any ideas?
Regards
LL
This topic is locked and no more replies can be posted.