Jump to content

Recommended Posts

Posted

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>
  • 4 weeks later...
Posted

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>

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.