title: Best way to disable entire form on PHP condition?
body: <p>I have a site (like many). I want to <em>show</em> but disable a particular form based on whether they are logged in or not. The way I show if the user is logged in is via a cookie set by PHP. What I'm wondering is the best way to disable all the elements in the form when the user is not logged in.</p>
  
  <p>The solution I have at the moment is to get PHP to <code>echo</code> some JavaScript (jQuery to be precise) to the page:</p>
  
  <pre>
  $("#form_name").children("input, textarea").attr("disabled", "disabled");
  </pre>
  
  <p>Is this the right way to go, or is there a better way to be doing things?</p>