Hi, I've just installed Chronoforms, and it seems to be a very powerfull component !
I've created my first form, with textboxes and datepickers.
But I would like to add 2 hidden fields which contains automatically the connected user fullname and email in order to show it in the complete emailed form and to send a confirmation mail to the person who's filled the form.
Is it possible?
Thx for help and for this beautiful component !
I've created my first form, with textboxes and datepickers.
But I would like to add 2 hidden fields which contains automatically the connected user fullname and email in order to show it in the complete emailed form and to send a confirmation mail to the person who's filled the form.
Is it possible?
Thx for help and for this beautiful component !
Hi r4z,
Sure, you can get the user info from the Joomla User object:
Bob
Sure, you can get the user info from the Joomla User object:
<?php
$user = & JFactory::getUser();
?>
<input type='hidden' name='email' value='<?php echo $user->email; ?>' />
<input type='hidden' name='name' value='<?php echo $user->name; ?>' />
Bob
Thanks a lot for your answer.
Where can I put the code? In "Main onLoad/View Code" > "HTML code" ?
Where can I put the code? In "Main onLoad/View Code" > "HTML code" ?
Nice thx🙂 it works great !
I've only got one issue in the mailing : {name} and {email} are visible in the mail content, but it doesn't work in the "From Email", "ReplyTo Email" and "Subject", it's showing strings "{name}" and "{email}". How can I resolve that please?
I've only got one issue in the mailing : {name} and {email} are visible in the mail content, but it doesn't work in the "From Email", "ReplyTo Email" and "Subject", it's showing strings "{name}" and "{email}". How can I resolve that please?
Hi r4z,
The "From Email", "ReplyTo Email" and "Subject" fields are all static, they do not change with form results. So they must contain text strings - valid emails for the first two.
If you want to use dynamic values then use the Dynamic ReplyTo Email, etc. and put field names in the boxes (with no quotes or brackets).
If you use ReplyToEmail then you may well need to use ReplyTo Name with it.
Bob
PS I strongly recommend that you do not use Dynamic From Email, your emails may be marked as spam and lost if you do.
The "From Email", "ReplyTo Email" and "Subject" fields are all static, they do not change with form results. So they must contain text strings - valid emails for the first two.
If you want to use dynamic values then use the Dynamic ReplyTo Email, etc. and put field names in the boxes (with no quotes or brackets).
If you use ReplyToEmail then you may well need to use ReplyTo Name with it.
Bob
PS I strongly recommend that you do not use Dynamic From Email, your emails may be marked as spam and lost if you do.
Ok, it works great.
For the dynamic subject, is it possible to mix static char string and a field content?
PS: I'm on an intranet, there is no problem for the spam
For the dynamic subject, is it possible to mix static char string and a field content?
PS: I'm on an intranet, there is no problem for the spam
Hi r4z,
You can mix fields and text in the box there but you can pre-process in the OnSubmit Before Box
Bob
You can mix fields and text in the box there but you can pre-process in the OnSubmit Before Box
<?php
$field_name = JRequest::getString('field_name', '', 'post');
$subject = "The value of field 'field_name' is $field_name";
JRequest::setVar('subject', $subject);
?>
Then use subject in the Dynamic Subject field.Bob
thx again and again ^^
2 other last thing lol (I hope).
First one : I'm forcing the user connection by putting this condition in the HTML form code (in order to prevent the from nobody mail or mail not sent) :
is it the better way to do it, or is there a special option to do it automatically?
Second one: I'm french and the datepicker format is american with sundays as First day of week, how can I manage that?
thx for your great help and fast answers !
2 other last thing lol (I hope).
First one : I'm forcing the user connection by putting this condition in the HTML form code (in order to prevent the from nobody mail or mail not sent) :
<?php
$user = & JFactory::getUser();
//var_dump($user);
if( $user->email != '' and $user->name != '' ){
....the form content
}else{
....No way you need to connect
}
?>
is it the better way to do it, or is there a special option to do it automatically?
Second one: I'm french and the datepicker format is american with sundays as First day of week, how can I manage that?
thx for your great help and fast answers !
This topic is locked and no more replies can be posted.