Redux-form validation of several tabs - reactjs

I have several tabs with redux-form fields. Of course, I have a validator, that have to validate just active tab. But there's a little problem. When I change active tab, validator checks fields value just if I try to do anything (click on any fields for example).
The question is How can I pass formProps to validator when I change active tab?

A have a similar app working fine here.
I followed "Wizard Form" strategy (http://redux-form.com/6.3.1/examples/wizard/), using 1 form per tab, all using the same form name.
Make sure you render just the body/form of the active tab, and don't submit when changing tabs.

Related

Tabbed Form in Ant Design Issue

Tabbed Form doesn't seem possible in AntDesign. all field error comes when we submit form inside tab
Blockers
On Submit only current active tab form values comes
Tabs are inside the form
all field error Comes when we submit form inside tab
destroyInactiveTabPane i try this but not working
If i have to generate tabs dynamically like English, French,
Italian, i cannot initialling Form as tab loop will come
inside of component
Forced render of content in tabs, not lazy render after
clicking on tabs i try this but not working
Error Validation Trigger when i submit form of all filed with in the form
Create forms inside each tab and in your parent file which will hold the tabs data, active tab manage the state.
Create form for each tab.
Suppose i have name and member tab i will create the form with
Const nameForm = useForm()
Const memberForm =useForm()
And pass each form as props to the component.
Nameform to name component and so on.
And whenever you will try to change the tab or click submit check in function which tab is active and validate that form only.

Is there a simple way to fake prepopulated suggestions onclick, but onchange show autocomplete resuts using material-ui autocomplete?

Id like to show a popper with data in it which represents a history of searched suggestions on click, but replace that with the default autocomplete dropdown on type, and keep it unless the input is blank. One idea I thought would work was using a onChange handler to detect the length of input typed... which Ive not managed.
On click of the highlighted value Id like to redirect to another page. Currently I'm using json object to hold a few strings, with urls like this.
To achieve the desired results, we will be maintaining two seperate options searchHistory options & the default options. We can toggle between the options by checking if the input field is empty or user has entered something to search through the default options.
I've modified your code on sandbox. Following is the link.
https://codesandbox.io/s/zen-northcutt-fnc03?file=/src/App.js

clearing a material-UI autocomplete field on the press of a button

I am using material-UI autocomplete for a project that involves rendering a dynamic array based on what you select from the menu. I am finished with the project and now trying to implement multi-select to make choosing things from the menu easier. When you have everything you want from the menu, you click an "Add" button that takes everything you currently have selected and adds it to a table (and adds the properly formatted text into a query on the side, the goal is to build queries for users without them worrying about syntax). When I was not using multiselect, and only adding one thing at a time to the query, I was easily able to clear the autocomplete field by changing the value prop to null. This prevents users from adding the same fields to the query over and over (when add is clicked the options that were added are popped from the list of options). When using multi the rules seem to change and now changing value directly causes an error. My question is, does anyone know of a way to programattically click the x button built in to material-ui autocomplete fields to clear that text field in an event handler? Or is there any reliable way of clearing that on my end?

Ant Design: Why are customized form components automatically validated as successful?

I've noticed that customized form components are automatically rendered with the has-success attribute. Why is this? Is there a way to fix this?
By default, errors are not shown and when a user submits the form, validation happens. But if you want has-error classes in all fields with invalid data, simply call this.props.form.validateFields() in componentDidMount method which will run validation and will add css classes to fields according to rules.

CodenameOne set indexing of fields for virtual keyboard

Using CodenameOne,
I have a Form that the user needs to fill in. All of the components, however, are actually Containers that represent custom functionality. As an example, I would have a TextField alongside a Button on a Container, and I would use that Container as a "Component". This allows me to create more advanced functionality by combining existing Components.
A good example of where this is necessary is that of a custom date entry field existing out of 3 TextFields or a combination of TextFields and ComboBoxes.
I have a "Field" that has functionality for that of a Contact Component.
This all serves as a single "Unit" in order to allow the user to choose a contact or fill in their own. Buttons open Dialog popups, etc.
My problems comes with when the user uses the Android keyboard. Should this Contact Object be the second "Field" and the user presses the 'Next' button on the Android keyboard, the App does not know what field to give focus.
Furthermore, If one of the fields are a ComboBox or a Button and the user presses next to reach that Component, the keyboard doesn't close, and instead removes the 'Next' button, replacing it with a return button or an emoticon selector.
Below is an example situation:
The user would press on the first field, the Keyboard shows up, and when the user presses next, the keyboard's Next button dissapears, as the immediate next field happens to be a Button or ComboBox.
Is there a way to change the focusing index, or omit certain fields form ever gaining focus in this way? I tried making the entire thing a Component but that doesnt allow me to combine other Components. Even if it is possible to make the parent Container a Component, how would I solve this particular issue?
The default behavior is to use the "next focus down" for this functionality so just use setNextFocusDown(nextTextField) on each one of the components. Notice that a ComboBox won't work as expected although you might want to change that to an AutoCompleteTextField which would.

Resources