Attribute autocorrect not allowed on element input at this point - w3c-validation

I have a problem validating my code.
input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'
w3c validator says the message: "Attribute autocorrect not allowed on element input at this point." I disabled the attribute autocapitalize but it doesn't work.

if you want to win with w3c validator, remove attributes that are not allowed on element and add them by javascript

Related

kendo ui, angular require validation for numeric text box

I am trying to use a kendo numeric text box with angular validation (ng-required) however I'm not able to get it working. The ng-required attribute on this element has no effect on the form validation status.
From my understanding, the reason why this doesn't work is because kendo numeric text box uses k-ng-model to store it's value, whereas the angular validation works only with ng-model.
Has anyone else seen this issue, are there any workarounds?
I have found a workaround that involves using the kendo-numeric-text-box along with a hidden input field which makes use of ng-model.
<input data-kendo-numeric-text-box data-k-ng-model="numValue"/>
<input type="hidden" data-ng-model="numValue" data-ng-required="true" />

How can i solve this "The name attribute is obsolete. Consider putting an id attribute on the nearest container instead."

I have find the plugin for one page scroll and where i have to enter the attribute like to effect the scroll when clicking on the menu BUT the issue is W3C is showing error there.
First way this type of format which is required for the code -
<a name="aboutus"></a>
I have tried this way too -
<a name="http://www.domain.com/newcopy/responsive/index.html#aboutus"></a>
but not success. Please help.
Also one more error "Element img is missing required attribute src."
<img width="300" height="200" data-original="img/port9.jpg" alt="Portfolio 4" class="lazy imp-responsive">
I have added this code so the lazy load will works.
In HTML5 (CR):
The a element must not have a name attribute (however, its use is under some circumstances obsolete but conforming). Instead, use the global id attribute.
The img element must have the src attribute.

ci_csrf_token was set to ” onmouseover=prompt(XSS) bad=”

i used ci_csrf_token hidden field in my forms.but any form in my script get alert with Acunetix Web Vulnerability Scanner.
alert details :
Cookie input ci_csrf_token was set to " onmouseover=prompt(965267) bad="
The input is reflected inside a tag element between double quotes.
in view source:
<input type="hidden" name="ci_csrf_token" value="\\" onmouseover=prompt(965267) bad=\"" />
can anyone help me to solve it?
You need to html attribute encode the token before you put it into the hidden field. Do you add it to the form on the client side or the server side? If you do it on the server side, you may want to do input validation to make sure the token is on the expected format.

JSF Validation Error from Component that is not Rendered

I have a form that has a field that needs to be rendered as a read-only value when in edit mode and as a drop-down select list when in create mode.
The read-only field (used in edit mode) is rendered as plain text using <h:outputText>. In create mode, the field is rendered <h:selectOneListbox> that has a required attribute of "true".
It seems to work as I expect most of the time, but occasionally I get a validation error when in edit mode (the select list box is not rendered) .
Here is the code snippet that has both fields defined with their rendered attributes set using the same boolean value (just one field negates the boolean to toggle).
<h:outputLabel id="lblBusinessArea" value="Business Area:" />
<h:panelGroup id="baGroup">
<h:selectOneListbox id="businessAreaList" size="1"
rendered="#{shiftDetailsController.canEditBusinessArea}"
converter="businessAreaConverter"
value="#{shiftDetailsController.selectedBusinessArea}"
label="Business Area"
required="true">
<f:selectItems id="businessAreaListItems" value="#{shiftDetailsController.businessAreas}" />
<a4j:support id="businessAreaA4j" event="onchange"
ajaxSingle="true" reRender="deploymentGroupList, positionPayGroupList, sapPremCodeList" />
</h:selectOneListbox>
<h:outputText id="businessAreaRO"
rendered="#{!shiftDetailsController.canEditBusinessArea}"
value="#{shiftDetailsController.selectedBusinessArea.busAreaDesc}" />
</h:panelGroup>
Below is a screen clipping showing the field (in edit mode) rendered as read only. The "save" button was clicked and I get a validation error message that the field is required.
The value should be there in the backing bean because the value displayed is from the same object (shiftDetailsController.selectedBusinessArea). The output text uses the description field on the business area ojbect and the select field uses the whole object where the SelectItem has the description in the label.
Any idea how this could be occurring? I could set the required attribute using the same boolean value that determines the rendered state...so that it is only required when it is rendered...but since this problem is intermittent...I don't know that will really help.
I also verified that no other components on the page inadvertently have a label value of "Business Area" (which is being used in the validation message) to mislead me in which component truly has a null value; this is the only one that has the label of "Business Area".
I figured out what was happening with this issue.
Prior to submitting the form and receiving the validation error. I was making a change that caused the flag controlling the two components' visibility to be reversed.
rendered="#{shiftDetailsController.canEditBusinessArea}"
In other words, what I was doing on the form was causing the canEditBusinessArea to change values. But, I was not re-rendering the panel group ("baGroup") to cause the UI to reflect the update.
Thus, when my form was submitted the component during the validation phase was seen as being required...triggering the validation to happen. As soon as I added "baGroup" to the reRender of the action that was flipping the edit business area flag, the UI began reflecting the update and the submitted form had the value.

Spring JSP form:input tag puts commas in int value

Using Spring 2.5 tag library,
I have an Integer value in a command form that's rendered on my page using <form:input path="budget" htmlEscape="true" />
When the value is > 999, it renders the number as value="x,xxx" on the page. My validation isn't expecting the comma and rejects the value.
Is there a fix for the rendering, or do I need to fix the validation and parsing?
As usual, I was just being blind, and discovered that there was a custom property editor bound to the command form in the controller. It was causing the input field to render with commas.
That would have been fine, if there also wasn't a JavaScript validation that rejected the field for having commas in it.

Resources