AnswerBun.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!

Related Questions

Node is not created, but nid is returned

2  Asked on December 26, 2021 by ziobudda

   

EntityDrupalWrapper->value() causes infinite recursion on user login?

1  Asked on December 24, 2021 by tigertrussell

   

Feed import breaks due to ajax error

1  Asked on December 24, 2021 by kenpeter

 

Multi site Image cache issue

0  Asked on December 24, 2021 by user99683

   

How to make relationships between users

1  Asked on December 22, 2021

   

Need CKEditor to encode special characters

1  Asked on December 22, 2021 by bemarlan

   

Checkboxes in a simple form are not displayed

1  Asked on December 22, 2021 by sebish

   

How to change scheduler date format in *_node_form

1  Asked on December 21, 2021 by oskar-calvo

   

hiding taxonomy terms on term page

1  Asked on December 21, 2021 by user3027413

   

TypeError on “drush config-export”

1  Asked on December 21, 2021

     

“Broken pipe” between Nginx and PHP-FPM

1  Asked on December 21, 2021 by stephen-winnall

 

Restrict delete operation on a node referenced by another node

2  Asked on December 19, 2021 by user48552

   

How to perform views date calculations using global math?

2  Asked on December 19, 2021 by tinohuda

   

Get menu link siblings

4  Asked on December 19, 2021 by erin-mclaughlin

 

Ask a Question

Get help from others!

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