Dojo Composite/Group validation - validation

Given 2 text fields that (e.g. House Number, and House Name) on a form, and in order to be valid the user must enter a number or name in the appropriate field before the 'group' of 2 fields is considered valid.
A user could enter just a house number, or a house name, but entering a value in either field marks both of them valid.
Is there a way to do this in Dijit/Dojo? The idea of a composite or group of validation elements would be perfect.
Thanks,

dijit.form.Form has an isValid function that by default makes sure all of its children dijit.form widgets are valid. You can use stock dijit.form.ValidationTextBox widgets in combination with attributes like regexp and required, or descendants like NumberTextBox to specify validation rules.

Related

Kentico 12: change value of one page type field based on value of another field

I have a custom page type with two fields, StateName and StateCode. I would like it so that when a value is selected in either of these fields, the other field’s value changes to match.
So for example, if I select “Alabama” in the StateName field, the value of the StateCode field would automatically change to “AL.” Or if I select “CO” in the StateCode field, the StateName field would automatically change to “Colorado,” etc. Is this possible?
(I have to keep these as two separate fields, because I need to display either the state name or the state code on the front-end depending on context. Therefore, I can’t use a single field with options like AL;Alabama because then the field only returns the value AL and I have no way of getting the display name Alabama).
I know Kentico has options for setting “dependent” fields, but that only appears to determine visibility – e.g. only display Field B if I select a particular value in Field A. I can’t find a way to actually change the selected value in one field based on the selected value in another field.
Two control solution seems some kind of an overkill here. You can use StateInfoProvider to get what you want.
StateInfo state = StateInfoProvider.GetStateInfo("Alabama")
The other way would be to use a simple drop down control and use
query like that :
select stateCode + '|'+ StateDisplayName, StateDisplayName from cms_State
to get get code and display name as value separated by |

Create DropDowns that are based on which criteria are searched for

I am trying to allow the user to search on any of 4 criteria and have the rest of the 3 remaining field data validate based on the first search for selection.
I have four fields that I am trying to make dependent drop downs for the remaining 3 based on what you search for 1st. For example:
Scenario 1 - I search the data range validation for NAME and select a name in Cell L2.
I want the Phone, Email and Address to become dependent on the name was chosen (as there may be multiple records with the name of the person chosen).
I have accomplished this by using a secondary filter formula to filter address based on the name chosen and then applied data validation from the filter.
My problem is that I can't seem to figure out how to do the same thing if they pick the address first. Because my data validation is set on the filtered values and not the entire database. If they picked the address first, I want to validate based on ALL addresses and then filter-validate the NAME, PHONE and EMAIL.
I really just want them to be able to search whatever of the 4 criteria and then validate the other 3 on that result.
Any thoughts would help.
You can see my formula for filtering Addresses based on the Name selection in Cell S2 of the Customer Record Tab.
=if(L6="Address",filter('Sample Data'!$C:$C,'Sample Data'!$E:$E=L6),IF(L6="Phone",filter('Sample Data'!$C:$C,'Sample Data'!$D:$D=L3),IF(L6="Email",filter('Sample Data'!$C:$C,'Sample Data'!$J:$J=L4),L2)))
https://docs.google.com/spreadsheets/d/1E7adi88aEgvdV4ao8unbMHgZLEyu5CCRdTOjv8thjtc/edit#gid=1427488050
Select Name and only the Phones, Emails and Addresses for that selected name can be selected.
Select the Address and only the Names, Phones and Emails for that Address can be selected.
Same for Phone and for Email

how to specify custom validation for user details like telephone number, last name etc. in Oracle Identity Manager?

I had logged in as xelsysadm in oracle identity manager and created different users, then i tried to create custom validation for fields such as telephone number and last name, but i don't know where to specify the regular expression and in what way the regular expression is to be specified. I had activated the sandbox,customized it and from the options i chose structure(located at the top left corner) and selected the telephone number column which is to be custom validated, then chose the corresponding tag for the telephone number column from right-side, then various display options were displayed such as VALUE, PARTIAL TRIGGERS etc, but i don't know where to specify the regular expression for validation and in what way it is to be mentioned.
I specified the below tag in VALUE field, but the result was not the expected.
af:validateRegExp pattern="/^+(\d+\s?)+$/"
Where to specify and how to specify the regular expression?
I specified af:validateRegExp pattern="/^+(\d+\s?)+$/" in the value field but it is not working as expected.
af:validateRegExp pattern="/^+(\d+\s?)+$/"
I expect the result to be like, when in future on creating a new user there should be strict validation for telephone number field like there must be a '+' sign in the beginning followed by numerical digits.

Orbeon Form Builder validation constraint on repeating element

I am using Orbeon Form Builder and have a form with a repeat section, containing a field named address as well as some other fields.
There can be a minimum of 4 repeats and a maximum of 6.
Is there a way to add a constraint on the repeating address field to make it mandatory unless it is the last item?
Say your repeat grid name is address (this is the name of the repeat grid, not the field). Then on the field you can use the following constraint:
empty(../following-sibling::address) or . != ''
Essentially, you're saying that this field is always valid if there are no following address iterations (which means we're on the last line), and other its value must be non-empty.

Table Validation for my DateFrom and DateTo in MS Access

What can I put in my table to validate so my 'DateFrom' is always before my 'DateTo' so that I can get a popup box stating date from cannot be after date to?
I am currently playing with the Validation Rules and Validation text in the Table by using
<="DateTo"
But it is not validating!
Access won't let you reference another field in the Validation Rule for a field. Use the Validation Rule from the table's property sheet instead.
Make sure to enclose the field names in square brackets as illustrated. Otherwise, Access may enclose them with quotes. And that won't work because the rule would then be based on a comparison of two strings.
Also supply your own Validation Text message if you want something other than the error text Access displays when the rule is violated.

Resources