Hugo Silva Posted December 11, 2020 at 11:20 AM Report Share #620646 Posted December 11, 2020 at 11:20 AM 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. Link to comment Share on other sites More sharing options...
washalbano Posted December 13, 2020 at 11:19 PM Report Share #620679 Posted December 13, 2020 at 11:19 PM Bom dia! O sr. já possui essas medidas em km? Vais precisar usar ajax para recuperar esses dados e exibí-los onde precisar Link to comment Share on other sites More sharing options...
Hugo Silva Posted December 17, 2020 at 04:01 PM Author Report Share #620767 Posted December 17, 2020 at 04:01 PM 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> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now