Hide a div on webform submission using ajax

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

Drupal Answers Asked on November 11, 2021

2 Answers

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() {

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

Can’t connect to remote DigitalOcean database

1  Asked on December 18, 2020 by ymdahi


How can I rebuild an image field with values in an Ajax callback?

1  Asked on December 17, 2020 by wassim-akermi


Breadcrumb/block settings

3  Asked on December 17, 2020 by zach


Change can I programmatically change the format of a view?

2  Asked on December 16, 2020 by user78498


How do I create a conditional form field?

2  Asked on December 15, 2020 by sean


I need to reference a custom field I created in User Profile

1  Asked on December 15, 2020 by user17021


How to use the uc_csv module for getting reports

1  Asked on December 15, 2020 by sathish


CKEditor displays entire site page when rich text is switched on

1  Asked on December 13, 2020 by amit-sedai


How do I get the video media path in a theme?

1  Asked on December 12, 2020 by mrfox


drush cannot update commerce kickstart

1  Asked on December 9, 2020 by ckosloff


How to add a javascript function after uploading file

2  Asked on December 9, 2020 by ahmed


Creating date field with only month and year

2  Asked on December 8, 2020 by blaine-lang


submitForm() isn’t called

1  Asked on December 7, 2020 by dylhof


Get the uri/path value of an image in the field template

2  Asked on December 7, 2020 by flamesquirrel


User registration silently fails – how to debug?

1  Asked on December 5, 2020 by druvision


Ask a Question

Get help from others!

© 2021 All rights reserved.