Tinymce, textarea in my textarea editor - tinymce

I use TinyMCE.
If I insert in my textarea (editor) another texarea, tinymce considers that the closing tag of this one is concerned and so he closes the editor. All code can be found there after outside the editor ...
Have you any idea?
Below code works :
<textarea id="elm1" name="elm1">
<input type="text" value="okokokok"/>
</textarea>
Below code don't works :
<textarea id="elm1" name="elm1">
<textarea>Blablablabla</textarea>
<input type="text" value="okokokok"/>
</textarea>
Here, "<input type="text" value="okokokok"/></textarea>" will be found outside editor...
Do you understand my problem ?

Remove all the ID attributes of "textarea" elements.
This will fix appearing a textarea inside the editor.

i had a same problem, rather then remove the id attr give them a id value, do not use "id" less textarea. it works in tinymce 4.
a <textarea id="try">textarea in </textarea> out of the textarea

Related

TinyMCE: are <input> elements wrongly handled?

I am encoutering various weird issues with <input> tags in TinyMCE (version 6, and also 5.8.2).
After entering the following in "code" view:
<input name="submit" value="myval" type="text">
I click "Save", the input field appears in the WYSIWYG view, but if I open the code view again, the name="submit" part has been removed. This does not happen with values other than "submit". Do you know why?
Also, the element selection does not work on inputs: with the following code:
<form>
<p>Firstname</p>
<input name="firstname" value="John" type="text">
</form>
Clicking on "Firstname" shows form > p in the editor footer, but clicking on the input field only shows p, like if the input element was not properly recognized.
Any clue to fix this?
Many thanks!

Vuejs how to prevent form submit on enter but still save work in inputs?

This prevent enter submit,but at the moment prevent enter in inputs.
I need that enterkey work in inputs but not submit form.
<template id="form-template">
<form action="save-passport" #keypress.enter.prevent method="post" enctype="application/x-www-form-urlencoded" >
<input type="submit" v-show="loaded" v-on:click="saveForm" value="Save" />
<input type="text" required="required" name="field-11" >
<select required="required" name="field-13"><option value=""></option>
</select>
</form>
</template>
Had the same problem. Solution I did was to put the submit method on the opening form tag. Then no need for the input/button type="submit" inside the form at the bottom.
<form class="form" action="" method="POST" #submit.enter.prevent="createForm()">
Also other options available on inputs:
#keydown.enter.prevent
#keyup.enter.prevent
#submit.enter.prevent
I did it this way
first i removed vue modifiers from form tag.
second i chaged type of input from submit to button
and third this my saveForm function
saveForm:function(){
if (someCondition){
event.preventDefault();
}else{
document.forms[0].submit();
}
}
You need to use the prevent modifier. Another thing, your webpage itself must have the focus. Meaning, if you just visit the webpage, prevent won't work. But, if you click somewhere in the form, prevent will work for you.
You can still submit the form via JavaScript using something like document.forms[0].submit();

How to use protractor to find the fading in content of tooltip generated by Angular-UI?

I am using Protractor, and trying to find the content of tooltips on the page. These tooltips are generated by Angular-UI, and fading in with moveMouse over them like below. Those tooltips are similar with ng-bind, but I cannot use binding to find them. Also, I tried to getAttribute of this tooltip, but it also didn't work for me, maybe cause protractor cannot detect this element name. Do you have any idea of how to read the content of those tooltips? Many thanks.
<div class="col-md-2">
<div class="form-group">
<label class="control-label" id="label_Merchant_Number" translate>merchant_NUM</label>
<input ng-model='searchCriteria.MERCHANT_NUMBER' tooltip="{{'merNumber_tooltip'|translate}}" class='form-control input-sm' type='text' id='MERCHANT_NUMBER' name='MERCHANT_NUMBER' maxlength='16' erng-validations>
</div>
</div>
we are using getAttribute('tooltip'), works how it should be ...
element(by.model('searchCriteria.MERCHANT_NUMBER')).getAttribute('tooltip');

Change label color in form with error

I'm buzy with a validation plug-in. When someone clicks on the submitbutton and the required fields are not filled, the border-color of the concerning fields changes to red. My problem however is that I also want the color of the text next to it to change. This is my structure:
<div class="row">
<label for="name">Name*</label>
<input type="text" id="name" name="name">
</div>
.form.a input.error {border:2px solid #eb053b;}
How can I now select the label-element to change the text color? It's not possible with CSS, because you can't select a parent-element, but I don't know how to do it with jQuery.
You can trigger this event on clicking the submit button
if(jQuery('.form.a input').css('border')==2px solid #eb053b){
jQuery(this).siblings('label').css('color','#eb053b');
}
As I mentioned in the comments, the jquery validator adds a label after the input box by default with a class 'error'. Though I haven't found the hack for stopping the validator from doing this yet, here is something that I practice in my forms.
HTML:
<div class="row">
<input type="text" id="name" placeholder="Name (required)" name="name">
</div>
CSS:
.form.a input.error {border:2px solid #eb053b;}
label.error { color: #ebo53b;}
FIDDLE
This would produce a meaningful error message in a label after the input box in red color.
The error messages can be customized using the rules option of jquery validator, the placement of label (before or after) is changed by the errorPlacement option.
I'll update my answer if and when I find the exact solution to your problem.

How can I send text from a textarea to a form?

I want to know how I can send text from a textarea to a form by clicking on a button. Both the textarea and form are on the same page. I've searched the site and the web but can't find the right answer. Any help would be great, thanks.
<form action="html_form_action_here" method="post">
<textarea rows="2" cols="20" name="text_area">
</textarea>
</form>