Jump to content

Formulário PHP


Hugo Silva

Recommended Posts

Bom dia pessoal, preciso da vossa ajuda num formulário. 

Estou desenvolver este formulário numa plataforma já existente. 

Objectivo é ao selecionar os locais de destino, por exemplo:

Départ: Porto / Destination: Lyon aparecer no quadrado "distance" os km correspondente entre os dois locais.... ou então por defeito no codigo escrever o km correspondentes aos dois locais.

Captura-de-ecra-2020-12-11-as-11.11.55.p

Hugo Silva

Link to post
Share on other sites
Em 13/12/2020 às 23:19, washalbano disse:

Bom dia!
O sr. já possui essas medidas em km?

Vais precisar usar ajax para recuperar esses dados e exibí-los onde precisar

Boa tarde,

Sim já tenho as medidas.

Este site já está feito por um antigo colega. 

Vou colocar aqui o código:

      <table style="width:800px; margin-left: -245px;" id="append">
        <tr class="tere2">
          <td style="width:150px;">Date</td>
          <td style="width:150px;">Départ</td>
          <td style="width:150px;">Destination</td>
          <td style="width:150px;">Motif</td>
          <td style="width:150px;">Distance</td>
        </tr>
        <tr class="tere" id="111222">
            
            <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
            <script>   
                $(function() {
                     $( "#calendar" ).datepicker();   
                }); 
            </script>            
          <td style="width:150px;"><input type="text" name="data_inicio[]" class="textbox dataa" id="calendar" ></td>
          <td style="width:150px;"><select name="destino[]" style="width:200px;" onChange="MudaKms('111222' , $(this).find(':selected').attr('data-kms'), $(this).find(':selected').attr('data-percurso'));">
              <option value="##">Départ</option>
              <option data-kms="" data-percurso="" value="Belges">Belges</option>
              <option data-kms="" data-percurso="" value="Bordeaux">Bordeaux</option>
              <option data-kms="" data-percurso="" value="Chantier">Chantier</option>
              <option data-kms="" data-percurso="" value="Lyon">Lyon</option>
              <option data-kms="" data-percurso="" value="Mérignac<">Mérignac</option>
              <option data-kms="" data-percurso="" value="Montpellier">Montpellier</option>
              <option data-kms="" data-percurso="" value="Paris">Paris</option>
              <option data-kms="" data-percurso="" value="Porto">Porto</option>
            </select></td>
          
            <td style="width:150px;"><select name="destino2[]" style="width:200px;" onChange="MudaKms('111222' , $(this).find(':selected').attr('data-kms'), $(this).find(':selected').attr('data-percurso'));">
              <option value="##">Destination</option>
              <option data-kms="" data-percurso="" value="Belges">Belges</option>
              <option data-kms="" data-percurso="" value="Bordeaux">Bordeaux</option>
              <option data-kms="" data-percurso="" value="Chantier">Chantier</option>
              <option data-kms="" data-percurso="" value="Lyon">Lyon</option>
              <option data-kms="" data-percurso="" value="Mérignac">Mérignac</option>
              <option data-kms="" data-percurso="" value="Montpellier">Montpellier</option>
              <option data-kms="" data-percurso="" value="Paris">Paris</option>
              <option data-kms="" data-percurso="" value="Porto">Porto</option>
            </select></td>
          
            <!--<td style="width:150px;"><input name="motivo[]" id="motivo_111222" class="textbox kmssoma" value="" type="text"></td>-->
            
            <td style="width:150px;"><select name="motivo[]" style="width:200px;">
              <option value="##">Motif</option>
              <option data-kms="" data-percurso="" value="Réunion commerciale">Réunion commerciale</option>
              <option data-kms="" data-percurso="" value="Bureaux Mérignac">Bureaux Mérignac</option>
              <option data-kms="" data-percurso="" value="Réunion Chantier">Réunion Chantier</option>
              <option data-kms="" data-percurso="" value="Audit Sarl">Audit Sarl</option>
              <option data-kms="" data-percurso="" value="Avocat">Avocat</option>
              <option data-kms="" data-percurso="" value="Prospection Clients">Prospection Clients</option>
            </select></td>
            
          <td style="width:150px;"><input name="kms[]" id="kms_111222" class="textbox kmssoma" value="" type="text"></td>
        </tr>
      </table>

 

Hugo Silva

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.