title: php change variable value dynamically after input text is typed
body: <p>I have one input box and I want to dynamically change variable value after text is typed in input box, but without pressing any button, only on text change.
  For example: </p>
  
  <pre><code>Input box= $5
  $text= input box value * 2
  </code></pre>
  
  <p>Anyone have idea how to do that?</p>
  
  <p>EDIT: I know that I must use JavaScript, but I'm not good at it and I don't know how to write code.</p>
  
  <p>EDIT2: I have this table:</p>
  
  <pre><code>&lt;tr&gt;
   &lt;td&gt;Mogući dobitak:&lt;/td&gt;
   &lt;td colspan='2'&gt;" . $dobitak . "&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Ulog:&lt;/td&gt;
   &lt;td&gt;&lt;input type='text' id='ulog' name='ulog' size='10' value='1' &gt;&lt;/td&gt;
   &lt;td&gt;&lt;input type='submit' name='submit' value='Uplati'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>So, after I enter value (default is 1) in input box (id='ulog') I want to change variable &amp;dobitak.
  Lets says that for this case input box value=$dobitak (I will add *2 later).</p>