ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Textarea bug?

megana 29 Dec, 2017
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:

<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...
Max_admin 30 Dec, 2017
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
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
megana 02 Jan, 2018
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
Max_admin 04 Jan, 2018
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
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
megana 04 Jan, 2018
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
megana 08 Jan, 2018
1 Likes
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:

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...
Max_admin 10 Feb, 2018
Answer
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
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
megana 12 Feb, 2018
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".
Max_admin 12 Feb, 2018
Hi megana,

The date field is in Chronoforms or Connectivity ? do you have the latest Chronoforms6 update ?

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
megana 14 Feb, 2018
1 Likes
Hi Max,

Just got the latest update and it works now, thank you!!

-Megan
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com