title: CAKEPHP Confirming on Submit
body: <p>I have a submit button in my form like this :</p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;end(__('Submit')); ?&gt;
  </code></pre>
  
  <p>and I want to embed variables that are part of the input form.  </p>
  
  <p>For example, I want to embed a variable that is input here <code>$this-&gt;Form-&gt;input('user_id');</code>.  </p>
  
  <p>Does anyone know how to do this?  I currently have this <code>onsubmit</code> as part of the options array, but it throws errors when I try to embed variables.  </p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;create('Shift', array(
      'onsubmit' =&gt; 'return confirm("Creating shift for '$id' on ");'
  )); ?&gt;
  </code></pre>
  
  <p>Now making an edit to this question.  So the Javascript solution worked fine.  Issue now is that I want the alert box to display the user's name, which is what is displayed in the dropbox.  However, the HTML tags contain the user's ids.  Here is the HTML</p>
  
  <pre><code>&lt;div class="input select required"&gt;
      &lt;label for="my_user_id"&gt;User&lt;/label&gt;
      &lt;select name="data[Shift][user_id]" id="my_user_id" required="required"&gt;
      &lt;option value="1"&gt;john doe&lt;/option&gt;
      &lt;option value="2"&gt;john johnson&lt;/option&gt;
  </code></pre>
  
  <p>Is there a way to access the value between the <code>&lt;option&gt;</code> tags using Javascript?</p>