title: redirect to another page after submitting a form
body: <p>How can I redirect to another page after submitting a form? What code is needed to add my code?? This is my code simple.js</p>
  
  <pre><code>import React from 'react';
  import { Field, reduxForm } from 'redux-form';
  
  
  const SimpleForm = props =&gt; {
    const { handleSubmit, pristine, reset, submitting } = props;
    return (
      &lt;form onSubmit={handleSubmit}&gt;
        &lt;div&gt;
          &lt;label&gt;First Name&lt;/label&gt;
          &lt;div&gt;
            &lt;Field
              name="firstName"
              component="input"
              type="text"
              placeholder="First Name"
              required
            /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;label&gt;Last Name&lt;/label&gt;
          &lt;div&gt;
            &lt;Field
              name="lastName"
              component="input"
              type="text"
              placeholder="Last Name"
               required
            /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;label&gt;Email&lt;/label&gt;
          &lt;div&gt;
            &lt;Field
              name="email"
              component="input"
              type="email"
              placeholder="Email"
               required
            /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;label&gt;Sex&lt;/label&gt;
          &lt;div&gt;
            &lt;label&gt;
              &lt;Field name="sex" component="input" type="radio" value="male" /&gt;
              {' '}
              Male
            &lt;/label&gt;
            &lt;label&gt;
              &lt;Field name="sex" component="input" type="radio" value="female" /&gt;
              {' '}
              Female
            &lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;label&gt;Favorite Color&lt;/label&gt;
          &lt;div&gt;
            &lt;Field name="favoriteColor" component="select" &gt;
              &lt;option /&gt;
              &lt;option value="ff0000"&gt;Red&lt;/option&gt;
              &lt;option value="00ff00"&gt;Green&lt;/option&gt;
              &lt;option value="0000ff"&gt;Blue&lt;/option&gt;
            &lt;/Field&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;label htmlFor="employed"&gt;Employed&lt;/label&gt;
          &lt;div&gt;
            &lt;Field
              name="employed"
              id="employed"
              component="input"
              type="checkbox"
            /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;label&gt;Notes&lt;/label&gt;
          &lt;div&gt;
            &lt;Field name="notes" component="textarea"  required /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;button type="submit" disabled={pristine || submitting}&gt;Submit&lt;/button&gt;
          &lt;button type="button" disabled={pristine || submitting} onClick={reset}&gt;
            Clear Values
          &lt;/button&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    );
  };
  
  
  export default reduxForm({
    form: 'simple', // a unique identifier for this form
  })(SimpleForm);
  </code></pre>
  
  <p>This is the simple form , I want to direct to a login page called asyncValidateform.js.. HERE IS THAT PAGE..</p>
  
  <pre><code>import React from 'react';
  import { Field, reduxForm } from 'redux-form';
  import validate from './validate';
  import asyncValidate from './asyncValidate';
  
  const renderField = (
    { input, label, type, meta: { asyncValidating, touched, error } },
  ) =&gt; (
    &lt;div&gt;
      &lt;label&gt;{label}&lt;/label&gt;
      &lt;div className={asyncValidating ? 'async-validating' : ''}&gt;
        &lt;input {...input} type={type} placeholder={label} /&gt;
        {touched &amp;&amp; error &amp;&amp; &lt;span&gt;{error}&lt;/span&gt;}
      &lt;/div&gt;
    &lt;/div&gt;
  );
  
  const AsyncValidationForm = props =&gt; {
    const { handleSubmit, pristine, reset, submitting } = props;
    return (
      &lt;form onSubmit={handleSubmit}&gt;
        &lt;Field
          name="username"
          type="text"
          component={renderField}
          label="Username"
        /&gt;
        &lt;Field
          name="password"
          type="password"
          component={renderField}
          label="Password"
        /&gt;
  
        &lt;Field
          name="confirmpassword"
          type="password"
          component={renderField}
          label="Confirm Password"
        /&gt;
        &lt;div&gt;
          &lt;button type="submit" disabled={submitting}&gt;Sign Up&lt;/button&gt;
          &lt;button type="button" disabled={pristine || submitting} onClick={reset}&gt;
            Clear Values
          &lt;/button&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    );
  };
  
  export default reduxForm({
    form: 'asyncValidation', // a unique identifier for this form
    validate,
    asyncValidate,
    asyncBlurFields: ['username'],
  })(AsyncValidationForm);
  </code></pre>
  
  <p>&amp; this is my validate page</p>
  
  <pre><code>const validate = values =&gt; {
  
  
    const errors = {};
    if (!values.username) {
      errors.username = 'Required';
    }
    if (!values.password) {
      errors.password = 'Required';
    }
    if (!values.confirmpassword ) {
      errors.confirmpassword = 'Required' ;
    }
     else if (values.confirmpassword !== values.password) {
      errors.confirmpassword = 'Password mismatched' ;
    }
  
  
  
  
    return errors;
  
  
  };
  
  export default validate;
  </code></pre>
  
  <p>index.js page</p>
  
  <pre><code>import React from "react";
  import ReactDOM from "react-dom";
  import { Provider } from "react-redux";
  import { Values } from "redux-form-website-template";
  import store from "./store";
  import showResults from "./showResults";
  import SimpleForm from "./SimpleForm";
  
  
  const rootEl = document.getElementById("root");
  
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;div style={{ padding: 15 }}&gt;
        &lt;h2&gt;Simple Form&lt;/h2&gt;
        &lt;SimpleForm onSubmit={showResults} /&gt;
        &lt;Values form="simple" /&gt;
      &lt;/div&gt;
    &lt;/Provider&gt;,
    rootEl
  );
  </code></pre>
  
  <p>What all changes need to make in my code??I want to first enter into the simple.js page after entering details and by clicking the submit the  page must redirect to asynValidateForm.js page.. Please help me to sort out this problem..
  Thank you ...</p>