Jump to content

Loading form editor with ajax


Gil Ronen
 Share

Recommended Posts

Do you have any errors in your browser console?

Are you using Cloudflare with "Rocket loader" enabled by chance? This will break editors loaded via AJAX (a built in example would be when you attempt to send another user a PM, the form to send the PM opens up in a modal, loaded via AJAX - does that work, or is that broken too on your site?).

Link to comment
Share on other sites

21 hours ago, bfarber said:

Do you have any errors in your browser console?

Are you using Cloudflare with "Rocket loader" enabled by chance? This will break editors loaded via AJAX (a built in example would be when you attempt to send another user a PM, the form to send the PM opens up in a modal, loaded via AJAX - does that work, or is that broken too on your site?).

I'm working on localhost, no errors in console.

Link to comment
Share on other sites

5 hours ago, bfarber said:

Does the editor work in the messenger?

The editor works, it works also in the same page on the first content that loads without ajax. when new content is loaded with ajax the editor in the ajax content doesnt work.

Link to comment
Share on other sites

My guess based on what you are describing is that there's an HTML element ID conflict, i.e. on the first page you have <textarea id='xyz'></textarea> that is turned into an editor, and then on the second page that editor hasn't been destroyed, but you have a new <textarea id='xyz'></textarea>

If that is the case, your two basic options are:

1) Ensure you fully destroy and remove the editor from the page before loading page 2 (preferred)

2) Use a unique field name/id for each page to prevent conflicts (this would just be a workaround and not the ideal solution)

Link to comment
Share on other sites

1 hour ago, bfarber said:

My guess based on what you are describing is that there's an HTML element ID conflict, i.e. on the first page you have <textarea id='xyz'></textarea> that is turned into an editor, and then on the second page that editor hasn't been destroyed, but you have a new <textarea id='xyz'></textarea>

If that is the case, your two basic options are:

1) Ensure you fully destroy and remove the editor from the page before loading page 2 (preferred)

2) Use a unique field name/id for each page to prevent conflicts (this would just be a workaround and not the ideal solution)

RlQjE32.png

Thats the code for the editor, I have a page with an editor loaded and working and if you do an action an ajax request loads another editor.

the only simmilar thing is the editor name("comment") and the key.

Edited by Gil Ronen
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...