title: store a button id in php variable
body: <p>I made changes in my code as suggested. Here's my updated code:</p>
  
  <pre><code>&lt;form  action="" method="POST"&gt;
          &lt;div class="btn-group btn-group-justified" role="group" aria-label="..."&gt;
              &lt;div class="btn-group" role="group"&gt;
                  &lt;input type="submit" class="btn btn-default" name="navbtnplace" value="&lt;?=$country?&gt;"&gt;
              &lt;/div&gt;
              &lt;div class="btn-group" role="group"&gt;
                  &lt;input type="submit" class="btn btn-default" name="navbtnplace" value="&lt;?=$state?&gt;"&gt;
              &lt;/div&gt;
              &lt;div class="btn-group" role="group"&gt;
                  &lt;input type="submit" class="btn btn-default" name="navbtnplace" value="&lt;?=$city?&gt;"&gt;
              &lt;/div&gt;
              &lt;div class="btn-group" role="group"&gt;
                  &lt;input type="submit" class="btn btn-default" name="navbtnplace" value="&lt;?=$user_name?&gt;"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;/form&gt;
  &lt;?php
  if(isset($_POST['navbtnplace'])) {
                      echo  $_POST['navbtnplace'];
  
                  }
                  ?&gt;
  </code></pre>
  
  <p>But it refreshes the page as well. How can I get the button value without page refresh?</p>