HubSpot / vex

A modern dialog library which is highly configurable and easy to style. #hubspot-open-source
http://github.hubspot.com/vex/docs/welcome
MIT License
6.92k stars 491 forks source link

How to integrate the tinymce editor in open windows? #240

Closed xiranst closed 6 years ago

xiranst commented 7 years ago

same the title. how to interagency the tinymce editor when open a window? i add tinymce.init({selector: '.tinymce'}); in the afterOpen function. there has one question: the form can not be submit when click submit button. i have filled content into the editor but the textear can not get the content, so form not be submit;

bbatliner commented 7 years ago

'but the texture can not get the content', what do you mean by this?

xiranst commented 7 years ago

@bbatliner sorry my typo. that is the textarea can not get the content from tinymce. please check the attachment.

11984791-8f99-4708-a13b-bc647178142b 8b9a3fd8-79e1-48ac-b405-460228328c59

because the textarea value is required, so this form can not be submitted. i try to alert some value in vex.onSubmit that is not working.

3700744c-4b5d-4998-9f53-a7c2dd468b24
bbatliner commented 7 years ago

I can't remember why vex-dialog uses a form at the moment, so in the meantime let's work around it.

Could you add another line of code to afterOpen that removes the required attribute from the hidden textarea? Something like:

$('#form_template_block_html').removeAttr('required')
xiranst commented 7 years ago

@bbatliner i add form into vex-dialog to save some works for user. i have removed the required attribute for textarea, but the form is still not submitted and the alert is not working in onSubmit funciton. maybe this question is about the tinymce and i will ask tinymce. thanks for your help.

bbatliner commented 7 years ago

image

I mean the vex popup has a form inside of it, which could be messing with the submitting. Ok, let me know what you find out.

xiranst commented 7 years ago

@bbatliner yes, i know the form in vex popup.

xiranst commented 7 years ago

@bbatliner i can submit the form data now. i remove the required attribute from php code not in vex. but the textarea must be required. so, i will research it again. thanks for your vex that is very nice plugin.