Joana Teixeira Posted February 9, 2018 at 02:28 PM Report #609275 Posted February 9, 2018 at 02:28 PM ola, eu estou a fazer um site de apostas em que tenho estas checkbox (codigo a seguir) e queria que automaticamente quando selecionada retornasse o valor selecionado para baixo , para o bilhete (codigo bilhete) , alguem me consegue ajudar? obrigada codigo checkbox: <div class="col-md-9"> <form> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="chb" />Simples (de 1 a 8) </label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="chb" />Combinada (de 2 a 8) </label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="chb" /><select id="myselect" onchange="change_myselect(this.value)" style= "width: 90px;"> <option value="">Múltipla</option> <option value="">2/3 combinações</option> <option value="">2/4 combinações</option> <option value="">2/5 combinações</option> <option value="">3/4 combinações</option> <option value="">3/5 combinações</option> <option value="">4/5 combinações</option> </select> </label> <script> $(".chb").change(function() { $(".chb").prop('checked',false); $(this).prop('checked',true); }); </script> </form> </div> <div class="col-md-2"> </div> </div> <div class="row"> <div class="col-md-1"> </div> <div class="col-md-9"> <form> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />1€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />2€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />5€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />10€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />20€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />50€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />75€</label> <label class="checkbox-inline"> <input type="checkbox" name="cb4" class="cb" />100€</label> <script> $(".cb").change(function() { $(".cb").prop('checked',false); $(this).prop('checked',true); }); </script> </form> </div> codigo bilhete, queria que o tipo de aposta fosse para tipo e o valor para aposta: <div class="panel-footer panel-primary ticketFooterTour"> <table class="table table-condensed text-center"> <tbody> <tr> <th class="text-center">Tipo</th> <th class="text-center">Odd</th> <th class="text-center">Aposta</th> <th class="text-center">Total</th> <th class="text-center">Resultado</th> </tr> <tr> <td class="type" value="combinada">tipo que vem de cima</td> <td class="totalBet" data-bet="2">aposta que vem de cima</td>
JakeBass Posted March 4, 2018 at 04:13 PM Report #609579 Posted March 4, 2018 at 04:13 PM no elemento select é preciso colocar valores <select id="myselect" onchange="change_myselect(this.value)" style= "width: 90px;"> <option value="Múltipla">Múltipla</option> <option value="2/3">2/3 combinações</option> <option value="2/4">2/4 combinações</option> <option value="2/5">2/5 combinações</option> <option value="3/4">3/4 combinações</option> <option value="3/5">3/5 combinações</option> <option value="4/5">4/5 combinações</option> </select> <script> function change_myselect(value) { $(".type").text(value); } </script>
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