title: How to get the value from a label
body: <p>Okay so the problem is that I have a label which is in a form and I'm trying to access this label when I press a button, my form looks like:</p>
  
  <pre><code>&lt;form method = 'POST'&gt;
  &lt;img src = 'ItemIcons/&lt;?php echo $ItemPicture;?&gt;.png' alt = '&lt;?php echo $row["ItemDesc"];?&gt;'/&gt;
  &lt;label name = 'lblItemName'&gt;&lt;?php echo $ItemName; ?&gt;&lt;/label&gt; 
  &lt;br&gt;
  &lt;label&gt; &lt;?php echo "Gold:" . $row["ItemPrice"]; ?&gt; &lt;/label&gt; 
  
  
  &lt;input type = 'submit' value = 'Buy &lt;?php echo $ItemName; ?&gt;' name = 'ItemPurchase'/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and my code for calling the button looks like:</p>
  
  <pre><code>if(isset($_POST['ItemPurchase'])) {
      $ItemName = $_POST["lblItemName"];
      ?&gt;
          &lt;script&gt;
              alert('&lt;?php echo $ItemName;?&gt;');
          &lt;/script&gt;
      &lt;?php
  }
  </code></pre>
  
  <p>Currently it alerts an empty value, it works when I place it as a textbox and not a label, but it needs to be a label sadly, any help would be great, thanks.</p>