title: How to open new ejs file after clicking the button?
body: <p>I am creating one form in which after clicking submit i want to open another ejs page.right now i am not able to do that.I am putting my 2nd file in action in app.js.</p>
  <p>app.js</p>
  <pre><code>app.get('/form1', function (req, res) {
      res.render('form', {
          title: &quot;Login&quot;, 
          action: &quot;/form1&quot;, 
          fields: [
              { name: 'Name', type: 'text', property: 'required' },
              { name: 'Email', type: 'text', property: 'required' }
              { name: 'Phone No', type:'text', property: 'required' }
          ]
      });
  });
  </code></pre>
  <p>The ejs file is given below</p>
  <p>form1.ejs</p>
  <pre><code>&lt;form action=&quot;&lt;%= action %&gt;&quot; method=&quot;post&quot;&gt;
      &lt;% if (fields.length) { %&gt;
          &lt;% fields.forEach(function(field) { %&gt;
              &lt;label&gt;&lt;%= field.name %&gt;&lt;/label&gt;
              &lt;input type=&quot;&lt;%= field.type %&gt;&quot; name=&quot;&lt;%= field.name %&gt;&quot;
                  &lt;% if (field.property) { %&gt;
                      &lt;%= field.property %&gt;
                  &lt;% } %&gt;
              &gt;
          &lt;% }) %&gt;
      &lt;% } %&gt;
      &lt;button type=&quot;submit&quot;&gt;&lt;%= title %&gt;&lt;/button&gt; &lt;!-- Title for button is same as that of the page --&gt;
  &lt;/form&gt;
  </code></pre>
  <p>the 2nd file which i want to open after clicking submit button.</p>
  <pre><code>&lt;form action=&quot;&lt;%= action %&gt;&quot; method=&quot;post&quot;&gt;
      &lt;h&gt; Data goes here &lt;/h&gt;
  &lt;/form&gt;
  </code></pre>