TinyMCE overwrite my valid required attribute to an invalid one.
I use TinyMCEv 4.7.4. I know it's old a little bit, but it is not possible to replace it, becasue of dependencies.
This is my config:
{
mode: "exact",
elements : "elm1",
extended_valid_elements: "hr[*],font[*],span[*],img[class,*],iframe[*],div[*],embed[*],script[*],a[*]",
}
I type this:
<input name="email" type="text" required />
And the editor change to this:
<input name="email" type="text" required="" />
And now the browsers don't handle the input as required one.
How can I solve this issue? Is there any specific option to tell TinyMCE "don't touch the required attribute" ?
Related
Below is the tag for a password field in Login form.
Our guys used the same class name for EMail field also. Hence I cannot use className for password to locate it in protractor, since xpath and css(id design changes) are not reliable, what is the best option for me?
Tag for Email field:
<input class="native-input sc-ion-input-md" aria-labelledby="ion-input-0-lbl" autocapitalize="off" autocomplete="off" autocorrect="off" name="ion-input-0" placeholder="" required="" type="email">
Tag for password field:
<input class="native-input sc-ion-input-md" aria-labelledby="ion-input-5-lbl" autocapitalize="off" autocomplete="off" autocorrect="off" name="ion-input-5" placeholder="" required="" type="password">
For submit button:
<ion-button _ngcontent-rbh-c129="" type="submit" color="loginbutton ion-margin" class="ion-color ion-color-loginbutton ion-margin md button button-solid ion-activatable ion-focusable hydrated">Login</ion-button>
I don’t suggest you to go with ion-input properties since it’s Ionic related properties generated during the build process and it can be dynamic.
Use type instead since it is:
Obvious
Static
input[type="email"]
And
input[type="password"]
After some time you will have hard time understanding your own code and trying to recall what ion-input-0
refers to.
By css:
element(By.css('input[name="ion-input-0"][type="email"]')),
and:
element(By.css('input[name="ion-input-5"][type="password"]')),
Since the last update to TYPO3 6.2.47 ELTS forms (the old core forms; without use of sysext "form") are no longer rendered normally ...
<input type="text" name="name" id="mailformname" size="30" value="" />
... but the input fields seem to be sent through an HTML encoder. It now looks like this in the source code:
<input type="text" name="name" id="mailformname" size="30" value="" />
How can this be fixed?
I couldn't find anything related to this in the changelog.
There's a new parseFunc, which is responsible for the issue
tt_content.mailform.20.stdWrap.parseFunc =< lib.parseFunc
You can overwrite this as follows
tt_content.mailform.20.stdWrap.parseFunc >
I want to define a checkbox in Binding.scala, like:
<input type="checkbox"
checked={elem.checked}
/>
elem.checked can have any String value (even an empty):the checkbox is always checked.
How can I get
<input type="checkbox"
checked/>
if checked, resp.
<input type="checkbox"/>
if not.
According to https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes , in XHTML 5, any text values means true.
Fortunately, Binding.scala XML literals allows attributes of Boolean type. If elem.checked is false (not "false"), the attribute will be removed.
We have the following code in which we are getting errors in the w3c validator for "Any input descendant of a label element with a for attribute must have an ID value that matches that for attribute." and "The label element may contain at most one input, button, select, textarea, or keygen descendant." Is this something that should just be ignored by the validator (as it is seeminlgly correct) or should it be changed to appease the w3c? Note this is html5 doctype.
<fieldset>
<label for="user_is_subscribed">
<input type="hidden" value="0" name="user[is_subscribed]">
<input type="checkbox" value="1" name="user[is_subscribed]" id="user_is_subscribed">
Newsletter Signup
</label>
<span class="checkLabel">We will never spam or give away your information</span>
</fieldset>
Thank in advance!
Labels should contain at most one input element. Move the hidden input out of the label. Also, when an input is a descendant of a label, the for attribute is superfluous.
<fieldset>
<input type="hidden" value="0" name="user[is_subscribed]">
<label>
<input type="checkbox" value="1" name="user[is_subscribed]" id="user_is_subscribed">
Newsletter Signup
</label>
<span class="checkLabel">We will never spam or give away your information</span>
</fieldset>
Is this something that should just be ignored by the validator
No
(as it is seeminlgly correct)
It isn't
or should it be changed
Yes
to appease the w3c?
No. It should be changed because it is wrong, and browsers have to error correct to figure out which element the label is associated with.
The label isn't labeling the hidden input, move it elsewhere.
I have some custom validation I'd like to do with jQuery. jQuery validation comes out of the box with a 'required' class. This means that I can have a script declaring
$('form').validate()
and the next textbox will validate correctly, based on the class 'required' I add to it:
<input type="text" value="" name="flowstatus" id="flowstatus" class="required">
My new validation rule is: the text in a textbox should be between 15 and 50 chars long. Is there a way to create my own custom rule/class to implement something like
<input type="text" value="" name="flowstatus" id="flowstatus" class="from15to50">
Note: This is NOT what I need:
('form').validate({
rules: {
flowstatus: {required: true, minlength: 15, maxlength: 50}
}});
This last script is too tightly coupled to the fields I want to validate.
I'm pretty sure that you can add an attribute to the desired element defining its min and max lengths. Something like:
<input type="text" value="" name="flowstatus" id="flowstatus" class="required" minlength="15" maxlength="50">
I'm not quite sure about the custom class solution, however.