Rich Textarea and AJAX Loading
Author | Posts |
---|---|
June 10, 2013 at 7:25 am 4722 | |
Tareq Hasan | Hi Tareq, I have a small issue here. Hi have 4 different forms with rich and normal textarea in 4 different pages. For some reasons, I have an other page with 4 buttons, one for each form. When the age is loaded, the first form is displayed. Not problem with the rich textarea at this point. Then I click on the second button, which load the second form through AJAX. But there, I have a problem rending the rich textarea... Could you help me ? |
June 10, 2013 at 7:26 am 4723 | |
noomia | This reply has been marked as private. |
June 10, 2013 at 8:10 am 4726 | |
Tareq Hasan | As far as I know, you can’t use tinymce with ajax. They can’t be initialized with ajax, only they can be initialized when the DOM is just ready. |
June 10, 2013 at 8:12 am 4727 | |
noomia | I cant’ initialize tinymce when the ajax request is done ??? |
June 10, 2013 at 8:24 am 4728 | |
Tareq Hasan | Seems like you can, the one I was talking about you can’t move through DOM once initialized. Anyway, this link will help you. |
June 10, 2013 at 8:45 am 4731 | |
noomia | How do you initialize the TinyMCE in WPUF ? |
June 10, 2013 at 9:25 am 4735 | |
Tareq Hasan | I just call |
June 10, 2013 at 9:29 am 4736 | |
noomia | If I call :
when the AJAX request is done, it works but I haven’t go the same theme as your tinyMCE… Do you know wich theme is used and what are the size generated with the wp-editor ? |
June 10, 2013 at 9:37 am 4737 | |
Tareq Hasan | Sorry, I’ve no idea. |
June 10, 2013 at 9:46 am 4738 | |
noomia | Ok, I’ve found the right solution (I think) :
Here is the line a call when the AJAX request is done : (post_content is the class of my textarea) Thanks Tareq ! |
June 10, 2013 at 10:24 am 4747 | |
noomia | Same problem with the address field and the google map. How do you load it ? |
June 11, 2013 at 7:53 am 4781 | |
Tareq Hasan | I load it via inline javascript. |
June 11, 2013 at 7:58 am 4783 | |
noomia | Ok but could you tell me how exactly ? I would like to add it in my .js file when the AJAX request is succeed. |
June 11, 2013 at 8:00 am 4784 | |
Tareq Hasan | see the |