How to make a show a table on clicking a button defined in <button> using jquery

Shehzi

I want to display a table when I click a button. The following code works doesnt work properly. The table is displayed but soon the page gets reloaded and it becomes blank again. The table is visible only for few seconds. Here is what I tried.

    <form class="form-horizontal form-label-left top_margin pad-top-20">

                            <div class="form-group">
                                <label class="control-label col-md-4 col-sm-4 col-xs-12">Select Class</label>
                                    <div class="col-md-5 col-sm-5 col-xs-12">
                                      <select class="form-control" name="Term-select">
                                        <option value="0">None Selected</option>
                                        <option value="1">1st Standard</option>
                                        <option value="2">2nd Standard</option>
                                        <option value="3">3rd Standard</option>
                                        <option value="4">4th Standard</option>
                                        <option value="5">5th Standard</option>
                                        <option value="6">6th Standard</option>
                                        <option value="7">7th Standard</option>
                                        <option value="8">8th Standard</option>
                                        <option value="9">9th Standard</option>
                                        <option value="10">10th Standard</option>
                                        <option value="11">11th Standard</option>
                                        <option value="12">12th Standard</option>
                                      </select>
                                    </div>
                             </div>

                   <div class="form-group">
                     <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-4">
                        <button class="btn btn-success float-right" id="Class_submit">Submit</button>
                       </div>
                  </div>            
     </form>
     <script>
        $(document).ready(function(){
        $("#Class_submit").click(function(){
        $("#Class_Marks").show();
        });
        });
     </script>
Rajesh Patel

By default <button> inside form is work as <button type="submit">
use preventDefault() or make <button type="button">

$("#Class_submit").click(function(event){
     event.preventDefault();
     $("#Class_Marks").show();
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Show table by clicking a button

From Dev

How to Hide/Show a Button upon clicking another Button using JavaScript

From Dev

How to Hide/Show a Button upon clicking another Button using JavaScript

From Dev

How to make or create flipcards dynamically using javascript or jquery on clicking a button or link?

From Dev

how to make table visible using radio button?

From Dev

How change the color of text when clicking a button using jquery?

From Dev

Adding new rows to table on clicking button in JQuery

From Dev

How to Show a Calender in android by clicking a simple button

From Dev

How to make a button show another button onclick?

From Dev

How to generate button with event and table using jquery

From Dev

How do I accept an image by clicking a button and turning the button into the image selected using jQuery?

From Dev

C# How to make another button appear by clicking a different button?

From Dev

how to change an image by clicking a button in jquery

From Dev

How to show inline details for html table with a toggle button using typescript

From Dev

How to get which button clicking using Tag

From Dev

Clicking a button using xpath

From Dev

Parse HTML table after clicking a button to make it visible

From Dev

Parse HTML table after clicking a button to make it visible

From Dev

CSS - Show element by clicking button

From Dev

how to show a message using jquery in html when radio button is enabled

From Dev

Make button active after clicking other button

From Dev

how to use dojo to show/hide DIV by clicking radio button?

From Dev

How to show the custom PDF template while clicking the button

From Dev

How to show or hide a div when clicking on the same button?

From Dev

How to show a toast and turn on bluetooth on clicking a button in a widget?

From Dev

how to use dojo to show/hide DIV by clicking radio button?

From Dev

How to show the custom PDF template while clicking the button

From Dev

How to show the attributes of an object when clicking a button in Windows forms?

From Dev

Clicking a button within an IE table

Related Related

  1. 1

    Show table by clicking a button

  2. 2

    How to Hide/Show a Button upon clicking another Button using JavaScript

  3. 3

    How to Hide/Show a Button upon clicking another Button using JavaScript

  4. 4

    How to make or create flipcards dynamically using javascript or jquery on clicking a button or link?

  5. 5

    how to make table visible using radio button?

  6. 6

    How change the color of text when clicking a button using jquery?

  7. 7

    Adding new rows to table on clicking button in JQuery

  8. 8

    How to Show a Calender in android by clicking a simple button

  9. 9

    How to make a button show another button onclick?

  10. 10

    How to generate button with event and table using jquery

  11. 11

    How do I accept an image by clicking a button and turning the button into the image selected using jQuery?

  12. 12

    C# How to make another button appear by clicking a different button?

  13. 13

    how to change an image by clicking a button in jquery

  14. 14

    How to show inline details for html table with a toggle button using typescript

  15. 15

    How to get which button clicking using Tag

  16. 16

    Clicking a button using xpath

  17. 17

    Parse HTML table after clicking a button to make it visible

  18. 18

    Parse HTML table after clicking a button to make it visible

  19. 19

    CSS - Show element by clicking button

  20. 20

    how to show a message using jquery in html when radio button is enabled

  21. 21

    Make button active after clicking other button

  22. 22

    how to use dojo to show/hide DIV by clicking radio button?

  23. 23

    How to show the custom PDF template while clicking the button

  24. 24

    How to show or hide a div when clicking on the same button?

  25. 25

    How to show a toast and turn on bluetooth on clicking a button in a widget?

  26. 26

    how to use dojo to show/hide DIV by clicking radio button?

  27. 27

    How to show the custom PDF template while clicking the button

  28. 28

    How to show the attributes of an object when clicking a button in Windows forms?

  29. 29

    Clicking a button within an IE table

HotTag

Archive