title: One Modal Bootstrap two action
body: <p>I have a Bootstrap modal that shows once your data in session and once empty fields in order to create a new user from the admin (I have two buttons "New" and "User In Session" that are pointing to the same modal). I used the session to populate the fields "User in session" with jQuery and I've deleted them to facilitate the insertion of the new user. Once erased, however, I have no more the button "User in session." </p>
  
  <p>How do I order to repopulate the fields with the session once deleted?</p>
  
  <pre><code>&lt;div id="modalInsertOrUpdate" class="modal fade" role="dialog"&gt;
      &lt;div class="modal-dialog"&gt;
  
          &lt;!-- Modal content--&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header centerMyText"&gt;
  
                  &lt;h4 class="modal-title"&gt;Gestione Dati&lt;/h4&gt;
              &lt;/div&gt;
  
              &lt;form id="formInserOrUpdate" class="form-horizontal" action="updateUtente.action"&gt;
  
                  &lt;div class="modal-body"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="id" class="col-sm-2 control-label"&gt;ID&lt;/label&gt;
  
                          &lt;div class="col-sm-9"&gt;
                              &lt;s:textfield readonly="true" type="text" name="id"
                                           value="%{#session.utenteLoggato.id}"
                                           class="form-control"
                                           id="id"/&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-1"&gt;
                              &lt;a href="#" id="infoId" data-toggle="popover" rel="popover" title="ID"
                                 data-content="ID generato automaticamente"&gt;&lt;span
                                      class="glyphicon glyphicon-info-sign"&gt;&lt;/span&gt;
                              &lt;/a&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label for="nome" class="col-sm-2 control-label"&gt;Nome&lt;/label&gt;
  
                          &lt;div class="col-sm-10"&gt;
                              &lt;s:textfield type="text" name="nome" class="form-control"
                                           value="%{#session.utenteLoggato.nome}"
                                           id="nome"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label for="cognome" class="col-sm-2 control-label"&gt;Cognome&lt;/label&gt;
  
                          &lt;div class="col-sm-10"&gt;
                              &lt;s:textfield type="text" name="cognome" class="form-control"
                                           value="%{#session.utenteLoggato.cognome}"
                                           id="cognome"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label for="mail" class="col-sm-2 control-label"&gt;Mail&lt;/label&gt;
  
                          &lt;div class="col-sm-10"&gt;
                              &lt;s:textfield type="email" cssErrorClass="errorLabel" name="mail" class="form-control"
                                           value="%{#session.utenteLoggato.mail}"
                                           id="mail"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label for="telefono" class="col-sm-2 control-label"&gt;Telefono&lt;/label&gt;
  
                          &lt;div class="col-sm-10"&gt;
                              &lt;s:textfield type="text" name="telefono" class="form-control"
                                           value="%{#session.utenteLoggato.telefono}"
                                           id="telefono"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;s:if test='#session.utenteLoggato.tipoUtente.equalsIgnoreCase("Admin")'&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label for="tipoUtente" class="col-sm-2 control-label"&gt;Permessi&lt;/label&gt;
  
                              &lt;div class="col-sm-10"&gt;
                                  &lt;select name="tipoUtente" id="tipoUtente" disabled&gt;
                                      &lt;option value="user" selected&gt;User&lt;/option&gt;
                                      &lt;option value="admin"
                                              &lt;s:if test='#session.utenteLoggato.tipoUtente.equalsIgnoreCase("Admin")'&gt;selected&lt;/s:if&gt; &gt;
                                          Admin
                                      &lt;/option&gt;
  
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/s:if&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label for="password" class="col-sm-2 control-label"&gt;Password&lt;/label&gt;
  
                          &lt;div class="col-sm-9"&gt;
                              &lt;s:textfield type="password" name="password" class="form-control"
                                           id="password"/&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-1"&gt;
                              &lt;a href="#" id="infoButton" rel="popover" data-toggle="popover" title="Password"
                                 data-content="La password deve essere di 8 caratteri."&gt;&lt;span
                                      class="glyphicon glyphicon-info-sign"&gt;&lt;/span&gt;
                              &lt;/a&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label for="passwordAgain" class="col-sm-2 control-label"&gt;Ripeti Password&lt;/label&gt;
  
                          &lt;div class="col-sm-9"&gt;
                              &lt;s:textfield type="password" name="passwordAgain" class="form-control"
                                           id="passwordAgain"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
  
                      &lt;div class="form-group"&gt;
                          &lt;div&gt;
                              &lt;div class="modal-footer"&gt;
                                  &lt;button type="button" class="btn btn-default pull-left" data-dismiss="modal"&gt;Close
                                  &lt;/button&gt;
                                  &lt;s:submit type="button" id="modificaButton" class="btn btn-primary pull-right"&gt;Modifica&lt;/s:submit&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  
  
  &lt;ul class="dropdown-menu"&gt;
  
          &lt;li&gt;&lt;a href="#" data-toggle="modal" data-target="#modalMyPassword"&gt;
              &lt;span class="glyphicon glyphicon-edit"&gt; Password&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  
          &lt;li&gt;&lt;a href="#" id="myUtente" data-toggle="modal" data-target="#modalInsertOrUpdate"&gt;
              &lt;span class="glyphicon glyphicon-pencil"&gt; Personale&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  
          &lt;s:if test='#session.utenteLoggato.tipoUtente.equalsIgnoreCase("admin")'&gt;
              &lt;li&gt;&lt;a href="#" id="addUtente" data-toggle="modal" data-target="#modalInsertOrUpdate"&gt;
                  &lt;span class="glyphicon glyphicon-user"&gt; *New&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;/s:if&gt;
  
          &lt;li&gt;&lt;a href="index.jsp"&gt;&lt;span class="glyphicon glyphicon-off"&gt; Logout&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  
      &lt;/ul&gt;
  &lt;/div&gt;
  &lt;s:include value="modalInsertOrUpdate.jsp"&gt;&lt;/s:include&gt;
  </code></pre>