Angular ng-form group errors - angularjs

I have one problem with form and ng-form.
Here is the sample https://jsfiddle.net/HB7LU/12182/
What I would like to do is display group messages.
eg. If I have 3 items and any are invalid then show the error message outside of ng-form.
I don't want to repeat every error message under input. If 3 inputs with name 'number' is invalid, I want to display only one message.
Does anyone have any ideas how to achieve this?

I figure it out.
https://jsfiddle.net/HB7LU/12189/
it works with angular 1.3+
but if someone have better solution I will like to see it.
Thanks.

Related

React-hook-form with material-ui does not show errors from rules

I'm new to using react-hook-form and after lots of research I stil cannot understand what I'm I doing wrong. I did a sandbox in which I have a simple input number.
How I would like my form to behave : I want the default value (16) to show and I want the errors below the input to show when the number does not respect the given rules (when the number is not between 16-99).
Can someone please help me understand? I'm going crazy! :s
Here is the sandbox link : https://codesandbox.io/s/crazy-northcutt-8wt6p?file=/src/App.tsx
Change the value of TextField's value to render's parameter value. Also add submit button in order the validation work.
I've forked your code for detailed code
https://codesandbox.io/s/heuristic-fire-eroqv

Umbraco cms AngularJS Regular Expression Keep appearing

Umbraco uses angularJS as based library and backoffice totally developed on it. The reason telling first is to tell that I have a field on which URL regular expression applied. If someone entered invalid url like below image
it shows error as need.
But if a user try to remove whole text by selecting it and removing at once. It still keep appearing the error like this
However, if a user erase text one by one like this
then the validation error removed and user need to click on button to see error again.
I would to know how screen 3 state can be achievable when user remove all text together? Its really annoying behavior for a user to remove text character one by one to refresh the state of the field. Screen 3 state should be applied on screen 2.
Can anybody tell me how it can fix or achievable? Right now, it seems like a default behavior.
Looking forward to hear from you guys. Suggestions will be much appreciatable.
Regards o
I've looked into this issue. This seems to be a product bug.
When you remove whole text at once, newValue is an empty string and the code responsible for resetting error messages doesn't run. If you have access to the umbraco code, you can easily fix it by removing highlighted check:

How to post the things which we want successfully?

I'm new to reactjs, i wanted to post the message through the fetch method successfully, as i 've raised the query but the solution didn't worked out for me and given negative votes for the query. I'm writing my problem because i have gone through similar links and i have tried but not getting expected output. Sometimes it's working fine and the next day it is showing error in res(json) line. And want to clear the message after posting but when i use this link solution "How to clear the input after posting the data through fetch and making the code execute successful" sometimes the message is getting disappear and sometimes message is not getting posted. Anyone help me in this? thanks in advance.
You need to use the value from the state inside input to be able to clear it:
<input
className="sendMessage"
onChange={this.handleChange}
name="body"
value={this.state.body} // Add input value
/>

cakephp: delayed flash messages

Is there any functionality that allow me do something like flash messages in cakephp? I don't want to use session, because it shows flash message on the next page.
For example:
user type link with mistake mysite?action=mistake and i want to check in controller if there isnt mistakes like this so i have array with some actions which are allowed and i check if $this->params['url']['action'] is there. If it isn't i want to show error to user , but this error shows only on second page (or if i reload). How can i avoid this?
The error you see is just a div with a concrete style. Something like:
<div id="flashMessage" class="error-message">Error</div>
What you could do is check with Javascript whatever you want to check and if it is not as expected, append the error div wherever you want.
That's what I have dont in some forms to show the error in real time.
If you want something more elaborate you could try this:
http://www.alfbd.com/cakephp-ajax-form-validation-with-jquery-and-jsonview/

not able to form post data for passing in extjs

I have a strange problem with POST data, i have two conditions
I had four input boxes with name
<input name="a[]"><input name="a[]"><input name="a[]"><input name="a[]">
and data is posted by method "&a[]=12&a[]=9&a[]=12&a[]=43".
but when i am using extjs i am hanged if i do
store.load({params:{ 'a[]':12 ,'a[]':9 , 'a[]':12 , 'a[]':43 }});
this only a[]=43 reached to the post data and never to the another end ,
also if i do
store.load({params:{ a[]:12 ,a[]:9 , a[]:12 , a[]:43 }});
this is an error
so please help to clear my concept
The name property corresponds to the HTTP field names for forms. These need to be unique. The system reads these in order. Thus, only the last one a[]:43 is read in. If you give each of the properties a unique name they will be read in...
e.g. (not tested)
<input name="a1"><input name="steaksauce"><input name="heinz"> <input name="57">
store.load({params:{ "a1" :"asdf", "steaksauce":"325", "heinz":"yummy", "57":"fitty"});
Please refer to The HTTP Forms documentation for more information
Why are you using input boxes with a format like this:
<input name="a[]"><input name="a[]"><input name="a[]"><input name="a[]">
Can you provide the exact code you are using?
this really works for the above problem Please solve that problem like this
store.load({params:{ 'a[0]':12 ,'a[1]':9 , 'a[2]':12 , 'a[3]':43 }});

Resources