I am trying to call validation event of ngNativeValidate on button click. You can find stackblitz at https://stackblitz.com/edit/angular-v5kuwk?file=src%2Fapp%2Fapp.component.ts
https://angular-v5kuwk.stackblitz.io/
In the stackblitz, "Test" button do not validate min and max value of input text number but submit button does.
How I can resolve this?
Related
Using AngularJS and i have a radio box which retrieves the list from Database on selected.
<input type="radio" id="activeMeetingRadio" class="form-check-input mt-0 p-3" ng-model="my.model" value="Active" ng-change="call to backend">
Once i select this radio my list is fetched and radio seems clicked, now after submit the forms,i sets the form as pristine and reset the checked value of radio to blank like below which makes the radio as unchecked.
my.model='';
but the issue is, even if i click the radio again, no event gets fired until i click another radio and then click back to this radio. Seems like a default bahaviour of AngularJS form controls. Is there any way i can make this radio fire event?
I was able to resolve this by setting the value in controller scope and then reset it using my.model='' will reset the value.
I have text box that is in a partial and exists in a collection.
I added the required on the input box, when nothing is in the textbox and i hit submit shows field is required message and disables the form submit button. However, then when i go type something in the text box message field is required stays and form is still disabled.
I removed the novalidateattribute on the form in case that was causing this.
How to set the custom validation message for radio buttons.
Tried adding oninvalid = this.setcustomvalidity('hsjsjs').
Able to set the message but on click of radio button also getting validation message
Can anyone tell me how to reset the setcustomvalidity
Have given oninvalid event and required attribute for both radio buttons
please try:
oninput="this.setCustomValidity('')"
I need nested forms. I know that they are not allowed in HTML, so I decided to set several submit buttons for one opened form.
In my controller I need to check which of the submit buttons is pressed. How can I do that?
I'm trying to give buttons names like this:
<input class="btn btn-primary" name="editAction" type="submit" value="Save"></button>
Then in my controller I check them like this:
if ($this->input->post('editAction'))
But it doesn't work.
If you are bound to have several submit buttons in your form, then you can do 2 things :
1) Convert submit buttons into normal buttons and submit form using ajax. This will solve your problem.
2) Convert submit buttons into normal buttons and maintain a hidden field on your form and onClick event of all buttons, just put the id of the button in that hidden field as a value, and then using jQuery, submit your form and then in your controller, check your hidden field value and then process the form.
if ($this->input->post('hidden_field_name'))
ill be needing your help again. I'm trying to make a drop-list with the use of a submit button. for example, i have a submit button which has a value = CAR
then if i clicked the submit button CARthe other 2 submit button display under the submit button of CAR.
see this link i hope this will help for you jsfiddle.net/2KEVg/2/