Readonly textarea element in a repeat group

Update: i've seen your modifications on Github, .. doesn't work or better say doesn't fully work: for an existing record, i can trigger the autofill only for the last instance of textarea.
Also, there is a problem with removing the groups and trying to add a new group (without submitting the form), the visual editor is toggled to plain text
 
Ok, we are almost there:

- the autofill plugin is triggered for adding new records and modifying the existing records! yuppie!!
- doesn't work:
if a group is removed from form then i cannot submit the form;
by removing a group and adding a new one, the visual editor is toggled to plain text
 
The visual editor issues are unlikely to get resolved any time soon. I've spent countless hours fighting with that stuff. The editor just wasn't written with this kind of usage in mind, creating and deleting instances on the fly. It's supposed to be possible, but it's just been an endless series of gotchas.

I should be able to fix the form submission thing though.

Hugh


Sent from my Nexus 7 using Tapatalk
 
Unfortunately, it doesn't work, i removed a group (without adding a new one) and i can't submit the form..

in Firefox debug i see a lot of warnings:

Code:
require js define jquery as  function m() 10:608:3
fields___field_class attach to form:TypeError: this.options.observe is null  fabrik.js:21:3
fields___field_subscription attach to form:TypeError: this.options.observe is null  fabrik.js:21:3
fields_6_repeat___field_extraoption_0 attach to form:TypeError: this.options.observe is null  fabrik.js:21:3
fields_6_repeat___field_extraoption_1 attach to form:TypeError: this.options.observe is null  fabrik.js:21:3
NS_ERROR_UNEXPECTED:  tinymce.min.js:5:0
 
I disabled that funky validation I wrote for you, which relies on other values in other groups being present, and it submits OK.

Are you sure the problem isn't that you are removing an option which has to be there for the validation?

I can't remember what the logic is for the validation, so I don't know how to test for it.

-- hugh
 
No, it's not related to this validation, i also tried to disable it before test. You can try with first record from list, remove the "E2" option and you'll see that the form cannot be submitted.

P.S: the validation should check that every "Mandatory" option has to be selected before submitting the form.Now is disabled and i cannot submit the form..
 
what browser do you use? Indeed, work fine in Edge and Internet Explorer, but i can't make it work in Firefox no matter what i've tried (clearing cache, removing browser history from begining, i even used a firefox extension to clean the cache)
 
Chrome.

I just tried it in FF and it throws an NS_ERROR_UNEXPECTED in TinyMCE when I delete a group, which screws up our form JS to the point it can't submit. A a quick google turns up ...

https://www.drupal.org/node/1907756

... where you can see people having similar issues after removing a TinyMCE instance. As I said in a previous post ...

I've spent countless hours fighting with that stuff. The editor just wasn't written with this kind of usage in mind, creating and deleting instances on the fly. It's supposed to be possible, but it's just been an endless series of gotchas.

And this is a classic example. We are doing everything the correct way, destroying the editor instance before we remove the DOM elements it uses ... but I suspect what is happening is that due to the asynchronous nature of JS, an event gets processed within TinyMCE fractionally after we have removed the DOM structure.

I'm guessing I've spent over 100 hours trying to get TinyMCE to behave in various setups, and it's a nightmare.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top