Angular JS Form Validation when the form is not active - angularjs

I am new to angular JS. I need help in the following case.
I am having an application which has a select box. It displays the list of products in the option. On changing the option, it displays different forms and the forms are dynamic. It means if I create a new product then only the forms are created. Now I need a way to validate the form fields for both the forms.
But the problem is when I select the laptop form, product form becomes undefined and vice versa. How can I validate both the forms together on the button click.
Please help me on this.

Related

Form made in ReactJs is not work with validation properly

I have a ReactJs project which is made using a class based component.
Bug - I have a form which contains (name, subject, email and reCaptcha) . I want functionality when any of the fields remains unfilled , so the submit button should be disabled but still I am facing the issue of getting submitted.
please refer to it for code https://pastebin.com/ExrNs7fM

Material UI next simple dialog add new contact

I am using the material-ui next branch and using the following example as reference for building a dialog.
https://material-ui-next.com/demos/dialogs/
https://codesandbox.io/s/7rq8nl11x
I wanted to know the best way to let the user enter a new contact as per material guidelines ie how to handle the UI for click of add contact button present in the bottom of the dialog. Would it be to hide this dialog and show a new dialog instead which shows a form letting the user enter a new contact.
I'm mostly looking for suggestions on design.
There's a lot of good information on the material design guidelines and best practices for managing components in React.
With that said, a good solution for your situation is to handle all the account management within the one modal. Here's an idea for a structure that's very similar to what Google does:
DialogContainer as the parent component to handle logic and contain the next two components.
AccountList to render each user as well as the 'add account' button.
AccountCreation component that renders the input to add another account.

How to touch all fields in redux form when we pre-populate values into the form?

I am using a redux wizard form to allow the users to create an application form.
The users have the ability to save the form filling process mid way and come back and re-edit it.
The problem is , when the users try to re-edit the application form, I populate all the form fields from the values the user had saved. But redux form doesn't enable the next button as the fields are not touched in this case.
How do I resolve this issue?

Can a salesforce custom button have some javascript in it?

What is the current way to do a custom button with some js in it?
We are building a custom button that needs to be able to read from the current contact (email address, phone, mailing address), and run a few lines of js. (We also need to create a call record.)
But how/where is this done in salesforce these days?
This page doesn't point me anywhere:
https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_enterprise.htm
And this explanation of the new method in Lightning isn't clear where the js lives:
https://developer.salesforce.com/forums/?id=906F0000000BWr4IAG
Where is the needed example/doc?
If you are using buttons on custom visualforce page there are no any problems with defining custom JS function for it. For example, if you use <apex:commandButton/> you can use such attributes as onclick, onkeydown, onkeyup and other. See more information in documentation.
If you are using buttons on object layouts, you can create custom button and chose executing of JS as a behavior, see attached screenshot.
If you mean some other cases, please, describe it.

In mvc pattern how to show another view

Hi im developing an winform application using mvc pattern,
If i have a windows form as a view with a button in it, and i want to show another view(winform) on click of button in the first form.
In this case whether the view should should notify the button click to the controller and the contoller will instantiate the second form and show or the first view itself will do this.
The controller should probably handle it. In the purest form of the MVC pattern, views should be for displaying their own content, and any other logic, including displaying other views, is up to the controller. (In fact, for many actions, that is all the controller ends up doing.)

Resources