Hi there, I am using CC6 and CF6. I have a connection with a Form view that is using {chronoform:FormName} to load my form. After some hunting through this forum, I figured out how to put {var:read_data2.Data2} into the Data Provider box so that my form will be pre-filled with the data from the connection Function.
However, I ran into a problem with a textarea.
The value for the textarea field should be:
But when I view the source of my form, this is what I see:
It's breaking the form so that it tries to put all the fields after the textarea into the textarea box too.
Help please!
EDIT: On a somewhat related note, I noticed that the Date fields also aren't filling in properly. I think this is because the values are in the wrong format from what the Date fields expect, but I can't figure out the correct location and syntax for reformatting the values. With CC5/CF5 I would just use PHP in a custom code box in the form's load event. If anyone has any advice on that...
However, I ran into a problem with a textarea.
The value for the textarea field should be:
<p>Test Intro</p>
But when I view the source of my form, this is what I see:
<textarea data-editor="1" data-autoresize="1" rows="10" name="intro" id="intro" value="<p><p>Test intro</p></textarea>
It's breaking the form so that it tries to put all the fields after the textarea into the textarea box too.
Help please!
EDIT: On a somewhat related note, I noticed that the Date fields also aren't filling in properly. I think this is because the values are in the wrong format from what the Date fields expect, but I can't figure out the correct location and syntax for reformatting the values. With CC5/CF5 I would just use PHP in a custom code box in the form's load event. If anyone has any advice on that...
Hi megana,
Please attach a backup of the "form" only.
You can also try to insert "<p>Test Intro</p>" in the textarea content box, does it display correctly ?
Another solution is to use {var:read_data2.Data2.text_area_name} in the content box of the textarea.
But your current config should work and is working for me here!
Happy new year!
Best regards
Please attach a backup of the "form" only.
You can also try to insert "<p>Test Intro</p>" in the textarea content box, does it display correctly ?
Another solution is to use {var:read_data2.Data2.text_area_name} in the content box of the textarea.
But your current config should work and is working for me here!
Happy new year!
Best regards
Hi Max,
Sure I have attached the form backup.
When filling out the form for a new entry, the textarea has a default "Content" value that includes several paragraphs with <p> tags and that all displays fine. I had changed it to "<p>Test Intro</p>" when testing the form and it submitted and saved to the database properly. It's only when editing that it doesn't fill in the textarea properly.
Thanks,
-Megan
Sure I have attached the form backup.
When filling out the form for a new entry, the textarea has a default "Content" value that includes several paragraphs with <p> tags and that all displays fine. I had changed it to "<p>Test Intro</p>" when testing the form and it submitted and saved to the database properly. It's only when editing that it doesn't fill in the textarea properly.
Thanks,
-Megan
Hi Megan,
Since the problem is only when editing then I can not test it without a copy of the db table, or if you can give me access to the app page on your website ? you can send the link by PM if so.
The textarea with the problem is the one which has the wysiwyg editor ? if yes then did you try with the editor disabled ?
Best regards
Since the problem is only when editing then I can not test it without a copy of the db table, or if you can give me access to the app page on your website ? you can send the link by PM if so.
The textarea with the problem is the one which has the wysiwyg editor ? if yes then did you try with the editor disabled ?
Best regards
Hi Max,
Yes that's correct and I did try it with the WYSIWYG disabled but it had the same problem.
I'll send a PM with the info.
Thanks,
-Megan
Yes that's correct and I did try it with the WYSIWYG disabled but it had the same problem.
I'll send a PM with the info.
Thanks,
-Megan
This probably isn't the best way to fix this, but here's what I tried for now.
In libraries/cegcore2/helpers/html.php, I found this section:
And changed it to this:
Now my textarea is filled in properly but doesn't try to add an unnecessary "value" attribute.
Still trying to figure out this date issue:
In libraries/cegcore2/helpers/html.php, I found this section:
if($type == 'textarea'){
$this->tag = 'textarea';
$this->content = !empty($this->attributes['value']) ? $this->attributes['value'] : '';
if(empty($this->attributes['data-rows'])){
$this->attributes['data-rows'] = $this->attributes['rows'];
}
}
And changed it to this:
if($type == 'textarea'){
$this->tag = 'textarea';
$this->content = !empty($this->attributes['value']) ? $this->attributes['value'] : '';
$this->attributes['value'] = '';
if(empty($this->attributes['data-rows'])){
$this->attributes['data-rows'] = $this->attributes['rows'];
}
}
Now my textarea is filled in properly but doesn't try to add an unnecessary "value" attribute.
Still trying to figure out this date issue:
On a somewhat related note, I noticed that the Date fields also aren't filling in properly. I think this is because the values are in the wrong format from what the Date fields expect, but I can't figure out the correct location and syntax for reformatting the values. With CC5/CF5 I would just use PHP in a custom code box in the form's load event. If anyone has any advice on that...
Hi megana,
β
Thank you very much, I have applied the file to the next update!π
β
What problem do you have with the date field at the moment ?
β
Best regards
β
Thank you very much, I have applied the file to the next update!π
β
What problem do you have with the date field at the moment ?
β
Best regards
Thanks Max!!
β
For the dates, the problem is that I have the date field set to use the format mm/dd/yyyy, but it saves into the database in yyyy-mm-dd format. When I go to edit an entry, the date field doesn't populate. For now, I just changed the date field to use yyyy-mm-dd format and now it populates fine, but we have people get annoyed because it's not "easy to read".
β
For the dates, the problem is that I have the date field set to use the format mm/dd/yyyy, but it saves into the database in yyyy-mm-dd format. When I go to edit an entry, the date field doesn't populate. For now, I just changed the date field to use yyyy-mm-dd format and now it populates fine, but we have people get annoyed because it's not "easy to read".
Hi megana,
β
The date field is in Chronoforms or Connectivity ? do you have the latest Chronoforms6 update ?
β
Best regards
β
The date field is in Chronoforms or Connectivity ? do you have the latest Chronoforms6 update ?
β
Best regards
This topic is locked and no more replies can be posted.