title: PHP Form inside bootbox
body: <p>I'm new in PHP and Javascript, and have a few questions, if someone can help me please.
  I have this PHP form inside a bootbox, as it is in the image:
  <a href="https://i.stack.imgur.com/w3Rjh.png" rel="nofollow noreferrer">Image of the bootbox</a></p>
  
  <p>The code:</p>
  
  <pre><code>function dialogUpload() {
      bootbox.confirm({
          message:  '&lt;form action="../Control/upload.php" method="post" enctype="multipart/form-data"&gt; '
                  + '     Nome do objeto:&lt;br /&gt;'
                  + '     &lt;input name="objectname" type="text"&gt;&lt;br /&gt;'
                  + '     Objeto 3D(Formato &lt;b&gt;.dae&lt;/b&gt;):&lt;br /&gt;'
                  + '     &lt;input name="userfile[]" type="file" /&gt;&lt;br /&gt;'
                  + '     Imagem 2D do objeto(Formato &lt;b&gt;.png&lt;/b&gt; ou &lt;b&gt;.jpg&lt;/b&gt;) (&lt;i&gt;Opcional&lt;/i&gt;):'
                  + '     &lt;input name="userfile[]" type="file" /&gt;&lt;br /&gt;'
                  + '     Comentário:&lt;br /&gt;'
                  + '     &lt;textarea name="comment" rows="5" cols="75"&gt;&lt;/textarea&gt;'
                  //+ '   &lt;input type="submit" value="Send files" /&gt;'
                  + '&lt;/form&gt;',
          buttons: {
              confirm: {
                  label: 'Enviar Arquivo',
                  className: 'btn-success'
              },
              cancel: {
                  label: 'Cancelar',
                  className: 'btn-danger'
              }
          },
          callback: function (result) {
              if(result){
  
              }
          }
      });
  </code></pre>
  
  <p>There are somethings I'd like to do with this form:</p>
  
  <ul>
  <li>Submit form using the "Enviar Botão" button(how to do it in the callback??)</li>
  <li>Verify if the file format is the valid format(.dae in the 1º and .png or .jpg in the 2º), and block it if it's not a valid format(showing an error message)</li>
  <li>Make the second file an optional input of the user</li>
  </ul>
  
  <p>I've seen a few answers on how to check formats on PHP, but nothing else..
  The tricky part is that the form is inside the bootbox window, so probably I would have to insert the code inside the <code>message</code> attribute...that's correct?</p>
  
  <p>Solution to the callback:</p>
  
  <pre><code>&lt;form name="uploadForm" action...&gt;
  callback: function (result) {
              if(result){
                  document.uploadForm.submit();
              }
          }
  </code></pre>