I would like show table after click button submit. I made function hide table and onload in body and second function show table and put it in submit button . Then table is visible only moment. So it is bad solution.
give your table a
display:none
in the css
then in Javascript , you capture the form submit , and change the display property of the element to block
Related
I want to create a new table with 1 row and 7 columns that will be displayed on my html page in the when I click on the button. How do I create this table using the onclick function in Javascript? The must also have an id. Thanks.
You should create the table in HTML, and use CSS to set the visibility to collapsed. Then you can change the visibility to visible in your onclick function.
I do not know if it's possible, but wanted to have a jsp page when loaded uam dropdown does not appear, but when I click a button.
Basically I want a button that makes the select box. that when clicked appear a list "option".
Already experimenting with various js events and jquery but none works. I had a div with style = "display: none;" and within the div I have the select. and wanted to show the option only when you click a button. It is possible ?
Thanks for listening
try this
$(document).ready(function(){
$('.mySelectbox').hide();
$('.myButton').click(function(){
$('.mySelectbox').val(-1); //clear selection of selectbox
$('.mySelectbox').show(); //show make the magic
});
});
this work for you?
I am trying to toggle a table column by providing a button in the header of every column, when user clicks on the button that specific column should be hidden and when user clicks it again it should open. But my problem is as i am hiding the whole column when user clicks on the button in the header user is not able to see the button. Can anyone suggest me how this can be achieved using jquery?
You can see the image as below
Thanks,
Praveen.
Table column hide or display
The best solution to the problem is place your button in th
jquery
$(document).ready(function() {
$('#btnHide').click(function() {
$('td:nth-child(1)').toggle();
});
});
Check out second case
Solved Checkout
I want to show Row #1 on default and then when you press the "load more" button, load another row each time. I already have the content in the rows (no need for AJAX) but I just want to be able to show it when the button's pressed.
See this jsFiddle example.
The JavaScript part, with jQuery:
$('#loadmore').click(function(){
$('tr.hide').first().removeClass('hide').addClass('show');
});
Use display: none; by default on all rows (except row #1).
Then on each click, use .show() on the given row or :
$('BUTTON_SELECTOR').click(function(){
$('ROWS_CONTAINER_SELECTOR:hidden:first').show();
});
If you already have the data then you can simply set the container div to overflow: hidden and resize it to display an extra row with each click.
$("#button").click(function(){
$("#container").css("height","+=150");
});
I have a jsfiddle here: http://jsfiddle.net/ybZvv/22/
The situation I have is that if you click on "Select All Answers" button, it will turn on all the letter buttons (al trun green). Now if you click on the "Add Question" button it appends the buttons from the top into a table row. You will see a bunch of text inputs appear below the table, this shows the values of all of the buttons which are turned on in the appended row.
This is fine. But the problem is below:
The problem though is that if you click on the "Remove All Answers" button IN THE APPENDED ROW, then all of the buttons are turned off which is fine but it does not remove/hide the text inputs for all of those values which buttons are turned off.
If you then click on the "Select All Answers" button IN THE APPENDED ROW, then it turns all ofthe buttons in the row but no text input appears showing all of the values which buttons are turned on.
So my question is that if the user clicks on the "Select All Answers" button in an appended table row, how can we get it to display all of the text inputs of the buttons which are turned on in that row?
Also if the user clicks on the "Remove All Answers" button in the appended row, I want it to remove all of the text inputs of those buttons turned off within that row. How can this be achieved?
The solution is to "trigger" a click on the buttons instead of simply taking off one class and adding another.
So instead of
$('.answerBtns:visible', context).removeClass('answerBtnsOff').addClass('answerBtnsOn');
you should use:
$('.answerBtnsOff:visible', context).trigger('click');
to simulate a click on the button to do proper handling.
Here's the edited fiddle