title: Declaring a Javascript variable into a PHP form
body: <p>Preapring for a Facebook competition while I have spare time, the Publish function with facebook has a once posted javascript function that you can define.</p>
  
  <p>What I am looking to do is call a function to write a value unto a php form which will then be posted and submitting data into a database. I have tested to the extent that I know the idea is sound just calling a basic alert, I am just not sure how to get from calling the function to writing the value into the form.</p>
  
  <p>This value I need to be able to call on in the page that the data is being posted to, to base an "if function" off, basically if "True/Yes" then I need it to process another php script in addition to the data its posting to the database</p>
  
  <p>What I have now is:</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
      function isShared()
      {
      alert("Yes");
      }
    &lt;/script&gt;
  &lt;input class="fieldbox" name='shared' type='hidden' value="value of 'display_alert()'"/&gt;
  </code></pre>
  
  <p>I know it cannot be an alert, but this is pretty much where my current javascript skills leave me stranded.</p>