Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter's bootstrap Form inside Modal
    primarykey
    data
    text
    <p>I'm using twitter's bootstrap to make a WebApp, on one of the features of the App I need to have some modals with form's inside. Those forms will be filled with data through some PHP scripts. I'm having problems using the modal feature with forms, the data for edition is correctly displayed in the fields, but I'can't seem to submit the form.</p> <p>This is my code:</p> <pre><code> &lt;a href="#edit_user_&lt;?php echo $row['id_user'] ?&gt;" role='button' data-toggle='modal' data-original-title='Edit User' class='btn btn-small btn-info time-link'&gt;&lt;i class='icon-pencil icon-white'&gt;&lt;/i&gt;&lt;/a&gt; &lt;button data-toggle='tooltip' data-original-title='Delete User' class='btn btn-small btn-danger time-link'&gt;&lt;i class='icon-trash icon-white'&gt;&lt;/i&gt;&lt;/button&gt; &lt;?php echo "&lt;/td&gt;"; echo "&lt;/tr&gt;";?&gt; &lt;div id="edit_user_&lt;?php echo $row['id_user']; ?&gt;" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt; &lt;h3 id="myModalLabel"&gt;Modal header&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;form action="" method="POST"&gt; &lt;label for="name"&gt;Name&lt;/label&gt; &lt;input type="text" name="name" value="&lt;?php echo $row['name']?&gt;"/&gt; &lt;label for="email"&gt;Email&lt;/label&gt; &lt;input type="text" name="email" value="&lt;?php echo $row['email']?&gt;"&gt; &lt;button type="submit" name="update_btn"&gt;Submit&lt;/button&gt; &lt;?php if (isset($_POST['update_btn'])) { if (isset($_POST['name']) &amp;&amp; $_POST['name'] !="") { if (isset($_POST['email']) &amp;&amp; $_POST['email'] !="") { $qstr_updateuser = "UPDATE `host_register`.`users` SET `name`=".$_POST['name'].", `email`= ".$_POST['email']." WHERE `users`.`id_user` = ".$row['id_user'].""; echo $qstr_updateuser; $update_user = mysqli_query($dbc,$qstr_updateuser); } } }?&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn" data-dismiss="modal" aria-hidden="true"&gt;Close&lt;/button&gt; &lt;button class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And for some reason I can't understand, the browser output's this:</p> <pre><code>&lt;div class="modal-body"&gt; &lt;form method="POST" action=""&gt;&lt;/form&gt; &lt;label for="name"&gt;Name&lt;/label&gt; &lt;input type="text" value="Pedro Oliveira" name="name"&gt; &lt;label for="email"&gt;Email&lt;/label&gt; &lt;input type="text" value="pedro.oliveira@est.pt" name="email"&gt; &lt;button name="update_btn" type="submit"&gt;Submit&lt;/button&gt; &lt;/div&gt; </code></pre> <p>I'm kind of clueless here! Is it a problem with bootstrap or with my code?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload