Solved

Could you point a way to hide/show  a division  under circunstaces by using Bootstrap?

Posted on 2016-09-29
4
102 Views
Last Modified: 2016-09-30
Hi Experts

Could you point a way to hide/show  a division  under circunstaces by using Bootstrap?

 Accordingly to:
img001
By fiiling Houve Custo with Sim (Yes) the element Custo and the division with the 02 elements
Houve Reembolso?  and Reembolso must appear.

  <!-- EF Set/2016  - div-->
                                    <div id="divReembolso" class="hide">
                                    <div class="row">         
                                        <!-- EF Set/2016  - Houve Reembolso?-->
                                        <div class="col-xs-4 mb20">
                                            <label for="houve_reembolso" class="field-label text-muted mb10">Houve Reembolso?</label>
                                            <label for="houve_reembolso" class="validar field select">
                                                <select name="houve_reembolso" id='houve_reembolso'>
                                                    <option value="">Selecione ...</option>
                                                    <option value="S">Sim</option>
                                                    <option value="N">Não</option>
                                                </select>
                                            </label>
                                        </div>
                                         <!-- EF Set/2016 FIM  - Houve Reeembolso -->
                                   
                                    
                                 <!-- EF Set/2016  - Reembolso?-->
                                        <div class="col-xs-4 mb20 reembolso" style="display: none;">
                                            <label for="reembolso" class="field-label text-muted mb10">Reembolso</label>
                                            <div class="input-group">
                                                <span class="input-group-addon">
                                                    <i class="fa fa-money c-gray"></i>
                                                </span>
                                                <span class="validar">
                                                    <input type="text" name="reembolso" id="reembolso" class="form-control gui-input br-light light" placeholder="">
                                                </span>
                                            </div>
                                        </div>
                                    <!-- EF Set/2016 FIM  - Reeembolso -->
                                      </div>
                        
                                    </div>
                                    <!-- EF Set/2016 FIM  - div -->

Open in new window



jquery (doesn't running)

$(function () {
      

        $("#houve_custo").change(function() {
            var serv = $( "#houve_custo option:selected" ).text();

            if (serv != 'Sim')
                $(".custo").hide();
                
                //EF Set/2016
                $("#divReembolso").hide();
                //$("#divReembolso").addClass('hidden');
                //$("#houve_reembolso").hide();
                //$(".reembolso").hide();
                //EF Set/2016 - FIM
            else
                $(".custo").show();
 
                //EF Set/2016
                $("#divReembolso").removeClass('hidden');
                //$("#divReembolso").show();
               //$("#houve_reembolso").show();
                //$(".reembolso").show();
                //EF Set/2016 - FIM
        });

Open in new window


Could you point what must be changed to make it run?

Thanks in advance
0
Comment
Question by:Eduardo Fuerte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:Eduardo Fuerte
ID: 41821858
Sorry


I just omit the {  } in the jquery else. That's the problem.
 if (serv != 'Sim')
            {
                $(".custo").hide();
                $("#divReembolso").hide();
            }         
            else
            {
                $(".custo").show();
                $("#divReembolso").show();
            }

Open in new window

Open in new window

It runs that way
0
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41823083
var serv = $( "#houve_custo option:selected" ).text();

Open in new window

You can also do
var serv = $( "#houve_custo" ).val();

Open in new window

0
 

Author Closing Comment

by:Eduardo Fuerte
ID: 41823300
Thanks !
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question