问题
We have multiple copies of the same form (jobs for a resume, only hidden "job_id" field changes on each) and we want to use tinyMCE for the description textarea field.
On each form the description field is called "inputDec". TinyMCE seems to fail after one use, despite the fact that each of the forms are different with unique names.
Multiple instances are no problem, but are they possible when the ID is the same -- even if the forms are different -- all on the same page.
Thanks in advance for any suggestions on a way around this issue?
回答1:
Each ID attribute should be unique within the HTML document. Did you try to attach it to the elements with some classname? http://www.tinymce.com/wiki.php/Configuration:editor_selector
回答2:
Basically the same as above, but I'll clarify it abit more :P
Check that:
- All Forms have different IDs
- All inputs have different IDs
回答3:
Hide the Instance of the tinymce that it creates by default i.e with the id "mce_0_container" in Css. i.e
mce_0_container{display:none;}
. I have tried it and it worked well for me.
来源:https://stackoverflow.com/questions/9011721/multiple-instances-of-tinymce-on-fields-with-same-id