Valid input not recognized by IE 11 - angularjs

I have an input element on my form that accepts a date/time. It has validation to check that it's a valid date/time. The default value for the field is the current date and time. When using Chrome, I can change the value of this input box multiple times, and as long as it is a valid date and time it will be accepted. However, in IE 11, if I change it to another valid date/time, it indicates an invalid value and will not allow the form to save.
The date/time field:
input#transit_date_arrived.form-control.date-time-picker(name='transit_date_arrived', ng-model='vehicle.transit_date_arrived', type='datetime')
In the vehicle model:
transit_date_arrived: {
type: sequelize.DATE,
allowNull: true,
validate: {
isDate: true
}
},
If anyone knows how to get this to work with Internet Explorer, I would really appreciate it, thanks!

One problem with IE and angularJS (in fact, maybe more than just a.JS) is that a field marked as invalid also spontaneously becomes "dirty" when typed in, tabbed through or otherwise interacted with. Apparently this also applies when validation resets the field, and on the second interaction the same happens.
According to a few questions and a bit of research, validation is actually very broken in IE. At this link, for example, determination between literal empty strings and invalid strings in impossible.
This link shows some issues that the author has come across in actual date verification, including error handling and false-date resolution. Unfortunately, his code has broken the definition for a "true" date - i.e. 0000.00.00 would be recognised as a valid date, due only to it's formatting.
There is an example of date verification here, which you may wish to use to append your code. in particular, you may wish to use $valid and $error.required.
There's also a very ugly piece of code here, which intends to allow validation in 4-step form.

Related

Drupal how to add form validate true to a form

I am getting
"An illegal choice has been detected. Please contact the site
administrator."
when I am trying to give term which doesn't exist in select box filter. I added validate true to the form_alter function for the particular its working and returning all data.How to add it dynamically without specifying the field name in the function.
$form['field_industry']['#validated'] = TRUE;
Else Is there any option to add form validate true in views
Thanks in advance
I got this message when trying to select certain Industries in a list. Some Industries worked, some generated the "illegal choice" message. The problem turned out to be that some Industry names had ampersands in them and others didn't. When I changed the ampersands to "and" that fixed it.

Updating the min/max templateOptions

Please have a look at the following jsbin
At first, numberTest requires the user to input a number between 5 and 10 (as noted by the description beneath it). If you press the change min/max button, the min/max fields are updated to 500 and 510. Again, you can see the description has updated to these new values.
However, it still requires the user to enter a value between the original min/max settings (5 and 10). How do I get the validation to see the new settings? Clearly, I am setting them correctly because the description under the field is updating correctly. It seems that the validation is stuck with the original values.
EDIT: I added better validation messages to the field. You can see that even the validation message thinks that the new min/max values are correct but the field still requires 5-10.
The problem is that you're not using expressionProperties to change the values, but changing them manually. angular-formly does a lot of optimizations to make sure we're not adding watchers that are unnecessary. expressionProperties is how you inform angular-formly that these values can change.
Here you go: http://jsbin.com/xenuqo/edit?js,output
For more on expressionProperties see this

How to control the display of numeric or alpha numeric keyboard on device?

I want to restrict type of entry (numeric or alphanumeric) by displaying the appropriate keyboard.
How to acheive that using JDEVELOPER MAF 12C?
i still dont get why people nowadays cant use google .... this took about 30 seconds to find, and i have never even heard of MAF before :
http://docs.oracle.com/middleware/mobile200/mobile/tag-ref/toc.htm#amx:inputText
<amx:inputText inputType="number">
inputType
Sets the type of data that the user should be allowed to provide. If
secret has been set to true or if the rows attribute has been set to
larger than 1, the input type will be treated as "text". This will not
guarantee an input format nor prevent the user from entering other
types of characters, it only serves as a mechanism to request that the
mobile device present the user with an optimized input mechanism for a
particular type of input value (e.g. a virtual keyboard with numbers
primarily displayed). Valid values are number, email, url, tel, or
text (default).

Checkboxes in ADF are initially null, where I want them to be 0

I am using ADF in JDeveloper and don´t have any experience with either of the two. Now I´ve run into quite some trouble yet, but for this particular thing I decided to consult the wisom of stackoverflow.
The thing is, I have an edit form for an object that contains 3 checkboxes. The checked values are set to 1, unchecked to 0. In my database, the values are NOT NULL, and I want to keep it that way.
The thing is, in the edit form, if the user submits the form leaving any boxes unchecked, it will result in an error, because the unchecked box values apparently remain null. Only after checking and then unchecking the boxes again, their values will be '0' rather than null.
I've tried some things, including making the attributes mandatory in the domain BCD, but that just gives a bit more neat error message..
Any help would be greatly appreciated!!
EDIT
I made a little progress thanks to the guide provided by Joe, but still run into problems.
I changed the values that should be checkboxes in my model, making them BOOLEANs where the table columns are NUMBERs (All are also mandatory and have a default value of 0).
This automatically changed the corresponding View Object too. In the Application module, this now works great. It shows checkboxes, a checked one will return 1, an untouched one will return 0.
However, I deleted the old form, and inserted a new one using the corresponding Data Control. I gave these values the checkbox type. I still had to edit the bindings (which I think reflects the problem, as this is not the case with, say, a model-level defined LOV) and gave them 1 for checked and 0 for unchecked.
However, now apart from the original problem still occurring, also the checkboxes cannot be unchecked after checking, and return 0 when checked (and null when left untouched).
Even though this has created new problems, it works correctly in my AM. Does someone know what I'm doing wrong in my Swing form?
this link might help:
http://theo.vanarem.nl/2010/07/07/adf-checkbox-representing-a-yes-or-no-value/
or
Extend the EO impl and override doDML and check each of the attributes - if null, set it to 0

Making Related Models Optional

I have a form where a user can enter a location address as well as the utility companies that provide service to that address. The Utility data is associated to the building:
Location hasMany Utility
Solely within the context of the utility, the name field is required so there's validation indicating as much. Within the context of a location, though, any utility information is optional. The user can choose not to enter that data when entering a location which would simply indicate that they don't want to associate the location with any or all of the utility companies we track.
Using the FormHelper, though, the validation is detected and the field gets marked as required. I want to retain that validation for the instances where utility data is being entered independently, but remove the required indicator on the location form.
I know I can hack this in any number of ways (e.g. removing the required class via javascript, etc.), but I'm wondering if there's a clean way to do this using the Cake API. I haven't seen anything obvious, so I'm hoping someone else has been here and found a clean, simple solution.
Thanks.
You can either ask the user how many utilities they want to add before creating the form, or you can add the Utility record inputs dynamically using js (the later is more work to do, and not as error-proof as the former).
An example of the view (if you want to do it in 1 view):
if (empty($this->data){
// a form to ask how many utility records the users want to create.
}else{
// generate the form based on user input.
}
I assume you know what to do in the controller.
I would add a class to the form element that are optionnal, and use that class to override the "required" indicator.
In fact there is a Cake solution, use the error param
$this->Form->input('Model.field', array('error' => false));
To disable error message output set the error key to false.

Resources