Because of the new European law I have to add a "Privacy policy" checkbox to the registration form.
We use "femanager" for the registration.
I did add a attribute "privacy" in the user entity and added a checkbox to the form:
<f:form.checkbox id="privacy" property="privacy" value="0" />
I also set the validator in the typoscript settings under: plugin.tx_femanager.settings.new.validation
privacy {
required = 1
}
unfortunately the validation doesn't seem to work.
I think you have a wrong path in your TypoScript-Settings.
plugin.tx_femanager.settings.new.validation {
privacy {
required = 1
}
}
Try this. :)
Related
Is it possible to add aria labels to a Kentico form. I am adding the forms to my pages using the online form widget and I would like to add aria labels to each section to help make my site more ADA compliant.
I don't see the option by default in Kentico. It's a good request though. What you would need to do is to create your own form control that has the property.
https://docs.kentico.com/k10/custom-development/developing-form-controls
What you would look to do is clone the Textbox, add a property called "AriaLabel" to the form control's properties, then add this to the new code file for the textbox
In Properties region:
public string AriaLabel
{
get
{
return ValidationHelper.GetString(GetValue("AriaLabel"), "");
}
set
{
if (txtValue.Attributes["AriaLabel"] != null)
{
txtValue.Attributes["AriaLabel"] = ValidationHelper.GetString(GetValue("AriaLabel"), "");
}
else
{
txtValue.Attributes.Add("AriaLabel", ValidationHelper.GetString(GetValue("AriaLabel"), ""));
}
}
}
In Page_Load at bottom:
if (txtValue.Attributes["AriaLabel"] != null)
{
txtValue.Attributes["AriaLabel"] = AriaLabel;
}
else
{
txtValue.Attributes.Add("AriaLabel", AriaLabel);
}
If you will utilize label attribute for a field it will generate label tag for it in the HTML layout which will be accessibility compliant. Will that solve your purpose or are you looking specifically for aria-label tag only?
I'm having trouble programmatically setting a checkbox in Angular 2. The following code fires onCheck() whenever the user checks the checkbox. I can also check the checkbox programmatically by setting this.select to 'true'.
<input type="checkbox" [(ngModel)]="v.checked" [checked]="select" (ngModelChange)="onCheck(v.checked)">
My problem is that when I set this.select to 'true', ngModelChange doesn't seem to detect the change and onCheck() doesn't fire... :-(
Any tips? Is there an alternative way to programmatically set a checkbox AND have its associated function fire?
you can use checkbox with component variable like :
#Component({
selector : 'my-component'
template : `<input type="checkbox" [(ngModel)]="selected"/>`
})
export class MyComponent(){
public selected: boolean = false;
}
I have the following gwt-bootstrap ui.xml :
<b:Typeahead ui:field="typeahead">
<b:TextBox ui:field="searchBox" searchQuery="true"
placeholder="Search..." />
</b:Typeahead>
How can i programmatically take the suggested response "On Click" of the the typeahead item and set it as Text into the searchbox?
Well the Adarsha Answer dont really work in my case, because i use full gwt. So my Solution is :
typeahead.setUpdaterCallback(new Typeahead.UpdaterCallback() {
#Override
public String onSelection(Suggestion selectedSuggestion) {
String text = selectedSuggestion.getDisplayString();
return null;
}
});
The below link will definitely helps you -
Get selected items value for Bootstrap's typeahead
once you get the selected value its just a matter of doing textbox.setValue(value).
extjs× 6627,3.x version, In mozilla browser reset is working for inputType :'file', but its not working for IE8 Browser and this is my code,
xtype :'textfield',
name:'Policy_fileUpload',
id :title+'_uploadFile',
inputType :'file',
fieldLabel :'Upload File and Location<font color=red>*</font>',
blankText :'Please choose a file',
anchor :'100%',
required :true,
autoShow :true
now am resetting this field by using the reset property
xtype:'button',extjs× 6627
id:title+'cancelButton',
width:100,
text:'Cancel',
listeners : {
'click':function(){
Ext.getCmp(title+'_uploadFile').reset();
}
help me to solve this Thanks in advance.
It seems to be a security 'feature' in IE8. Here are related topics where solution for this problem is given using jQuery:
Empty input type file doesn't work in IE
Clearing <input type='file' /> using jQuery
Both of them suggest something in the lines of recreating the input field. To do that in ExtJS 3.x, you may try something like this:
listeners : {
'click':function(){
var uploadField = Ext.getCmp('_uploadFile');
if (Ext.isIE8) {
var cfg = uploadField.initialConfig;
uploadField.destroy();
var parentCt = Ext.getCmp('parentContainer');
parentCt.insert(0, cfg);
parentCt.doLayout();
} else {
uploadField.reset();
}
}
}
Also, it seems that IE9 behaves in the same way. So you may want to have if (Ext.isIE) instead of if (Ext.isIE8).
I have an ASPxGridView with the following columns:
<dx:GridViewDataCheckColumn FieldName="ProtocolEnabled" Caption="Protocol Enabled">
<DataItemTemplate>
<asp:Literal ID="ltProtocolEnabled" runat="server" />
</DataItemTemplate>
</dx:GridViewDataCheckColumn>
<dx:GridViewDataColumn FieldName="ProtocolCount" Width="0" Caption="Protocol Count">
The checkbox column has a template with a literal in it so I can display Yes/No instead of an empty checkbox, but that's probably TMI. What I need to do is this:
In edit mode: When ProtocolEnabled is checked, I need to enable the ProtocolCount textbox. When ProtocolEnabled is unchecked, I need to disable ProtocolCount and set its text to 0.
I am not asking for a step-by-step, but a general pointer in the right direction. I would like to use callbacks if at all possible. I also promise I will not delete this question as you are answering it =P.
Update: Thanks to answerer, I was sent in the direction I needed to go. Here's the code I used:
<dx:GridViewDataCheckColumn FieldName="ProtocolEnabled" Caption="Protocol Enabled" CellStyle-HorizontalAlign="Left">
<DataItemTemplate>
<asp:Literal ID="ltProtocolEnabled" runat="server" />
</DataItemTemplate>
<PropertiesCheckEdit>
<ClientSideEvents CheckedChanged="function(s,e) {ProtocolEnabledChecked(s);}" />
</PropertiesCheckEdit>
</dx:GridViewDataCheckColumn>
<dx:GridViewDataColumn FieldName="ProtocolCount" Width="0" Caption="Protocol Count">
function ProtocolEnabledChecked(ck) {
var x = gvApplicationServer.GetEditor("ProtocolCount");
if (ck.GetValue()) {
x.enabled = true;
}
else {
x.SetValue(0);
x.enabled = false;
}
}
It's clientside code instead of callback.
First of all Check this for Accessing Controls Contained within Templates
To show Yes/No
On HtmlRowCreated Event access control and set it's text property after finding the control in the
Literal literal = ASPxGridView1.FindRowCellTemplateControl(e.VisibleIndex,
ASPxGridView1.Columns["Name"] as GridViewDataColumn, "ASPxButtonEdit1") as Literal ;
literal.Text = (bool)grid.GetRowValues(e.VisibleIndex, "columnName") ? "Yes" : "No";
In Edit Row Template Do as you did as above..
If you want to do some client side functionality then .. create client side event OnClientClick and use checkbox client side method. chkclientinstanceName.getValue(); or other to check with it is checked or not..
these controls are client accessible so enable/ disable by using txtClientName.SetEnabled(true/false);
for more help go to the
DevExpress.Web.ASPxEditors ClientScript namespace..
Try this step by step .. hope it will be helpful..