title: Add "ID" in onClick event of the PHP form dynamically
body: <p>I am trying to add an ID in the onClick event of the form input button but I am unable to figure out how it will take this dynamically every time when ID changes. For example:</p>
  <pre><code>&lt;form&gt;
      &lt;?php $gid= isset($_GET['gid']) ? $_GET['gid'] : 0;
                   $keyword= isset($_GET['keyword']) ? $_GET['keyword'] : '';
                   echo '&lt;input type=&quot;hidden&quot; name=&quot;gid&quot; value='.$gid.'&gt;';
                   echo&quot;$gid&quot;;
      
                   echo '&lt;input type=&quot;hidden&quot; name=&quot;keyword&quot; value='.$keyword.'&gt;';?&gt;
      
      &lt;input type=&quot;submit&quot; value=&quot;Sign Up&quot; class=&quot;p-pom-button&quot; id=&quot;lp-pom-button-720&quot; onclick=&quot;window.location.href='new.php?gid=xxxxxxx'&quot;; /&gt;
  &lt;/form&gt;
  </code></pre>
  <p>The ID is coming from the URL of the website, say, <a href="http://www.example.com/index.php?gid=123" rel="nofollow noreferrer">www.example.com/index.php?gid=123</a>. Here, index.php has the above code where it should come in onClick event automatically and once the user clicks, it will take the user to <a href="http://www.example.com/new.php?gid=123" rel="nofollow noreferrer">www.example.com/new.php?gid=123</a></p>