title: How do I prevent a pre-set INPUT value from being changed?
body: <p>I have a form where some fields are completed by loading information from a database.  These fields can vary from one account to another.</p>
  
  <p>When the form is submitted any database information will be sent along with new information entered in the form.</p>
  
  <p>However, the user is able to change (on screen) the information entered from the database, and although these changes are not submitted (my $Xvariables from the database override the POSTed $variables), I would like them to revert the on-screen data back to the database value.</p>
  
  <p>Here is an example of what I have at the moment, but it does not work ...</p>
  
  <pre><code>  &lt;input type="text" name="firstname" size="25" tabindex="4" onchange="if($xfirstname&lt;&gt;'') this.value=$xfirstname" value="&lt;?php echo $firstname;?&gt;"/&gt;
  </code></pre>
  
  <p>or better still, if there is a way, how can I make them unchangable if they have a value loaded from the database ?</p>