Hi,
how can I pass a joomla php variable to chronoform input field ?
I created a variable in joomla $title="home";
and I am calling the form with
{chronoforms6}zip-cnt{/chronoforms6}
in parallel I created in the chronoform a custom code before submitting the form
<?
$this->data['my_mark'] = $title;
?>
why can I not get the variable value in the my_mark variable in chronoform ?
what am I missing ?
thanks
reg
gp
how can I pass a joomla php variable to chronoform input field ?
I created a variable in joomla $title="home";
and I am calling the form with
{chronoforms6}zip-cnt{/chronoforms6}
in parallel I created in the chronoform a custom code before submitting the form
<?
$this->data['my_mark'] = $title;
?>
why can I not get the variable value in the my_mark variable in chronoform ?
what am I missing ?
thanks
reg
gp
Where in Joomla did you create the variable ?
Variables are limited to the scope in which they were defined, you need to set this variable in the $_POST then it will be available in Chronoforms data:
Variables are limited to the scope in which they were defined, you need to set this variable in the $_POST then it will be available in Chronoforms data:
$_POST['my_mark'] = 123;later in Chronoforms:
echo $this->data["my_mark"]; /// prints 123
ok and if I want to use this variable in a hidden field ?
thanks
regs
gp
thanks
regs
gp
sorry one more question, if I use this form (same form) in a for statement passing each time a different variable
I noticed that once the first form is submitted I cannot access to fields of the second and the third form and so I cannot fill them. I get always the success page of first form.
thanks
regs
gp
for ($i = 1; $i <= 3; $i++) {how can I pass this variable to each "form" in a hidden field (question above) and how can "exit" from first form when I is submitted.
$_POST['my_mark'] = $i;
{chronoforms6}zip-cnt{/chronoforms6}
}
I noticed that once the first form is submitted I cannot access to fields of the second and the third form and so I cannot fill them. I get always the success page of first form.
thanks
regs
gp
You can pass variables to the form in the plugin call:
{chronoforms6}form-alias&variable=value{/chronoforms6}
This topic is locked and no more replies can be posted.