Reputation: 928
I have a div, <div class="sectionCarouselCapabillities"> ... </div>
which - by default - is hidden from sight unless you make a change to a drop down. So the following:
$('.carouselUser').change(function(){
$('.sectionCarouselCapabillities').show()
});
States that when select box - with class: carouselUser
changes state, we show the div sectionCarouselCapabillities
. Great it works.
Problem?
After form submission that div is no longer visible because their is no change to the drop down ...
So what would I have to change to make it appear after change and stay visible AFTER form submision
Upvotes: 0
Views: 970
Reputation: 1042
Instead of using show(), you might want to add a class:
$('.carouselUser').change(function(){
$('.sectionCarouselCapabillities').addClass('is-active');
});
And in your CSS:
.sectionCarouselCapabillities.is-active { display: block; }
On the server side you can check if the form is posted. If so, add the is-active class on the div already.
Upvotes: 2
Reputation: 4099
I think in this case you'll need to set a cookie when the dropdown changes, and then read the cookie after the form submission.
Upvotes: 1