TransWikia.com

Hide a div on webform submission using ajax

Drupal Answers Asked on November 11, 2021

I am new to drupal i am using webform ajax module to submit my webform , its submiting values properly after validating them , but along with this i want to hide a div also on submit . what is the best way to do this

2 Answers

Your best option is probably to add an ID to the submit button, or get the ID thats already assigned to it, and stick a bit of jQuery into the header of that page.

(function ($) { 
$('#SubmitButton').click(function() {
     $('#DivYouWantToHide').hide();
});
})(jQuery);

Just replace the ID names with the ones you want to use.

Answered by Collins on November 11, 2021

The most effort-free way to hide something i can think to goes trough some CSS.

Inspect the div you want to hide for its id, then just add a rule in your theme CSS

#id { display: none; }

Answered by Astrayus on November 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP