How to hide message field after submitting a contact us form?

Solved
Buddings
Excursionist
37 1 3

Hello I am currently using an Ira theme. How do I hide the contact us form after submitting a message? such that it only shows the "Thank you for..." message after every successful submission

Screenshot 2021-07-11 183445.pngScreenshot 2021-07-11 183541.png

 

website: buddings.co

0 Likes
gasston
Explorer
38 8 16

Hello @Buddings 

1. Go to Online Store->Theme->Edit code

2. Asset : theme.js.liquid->paste below code at the bottom of the file.

 

$( document ).ready(function() {
    if($('.contact__success').text()!==undefined && $('.contact__success').text()!==''){
      $('.contact__content .contact__text').hide();
}
});

 

keep me posted if that corrects your problem

Belgacem

Belgacem Ben ltaif
Web consultant /Shopify Expert/ Founder @Funkydev.io
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
https://benltaif.dev
https://funkydev.io/
0 Likes
Buddings
Excursionist
37 1 3

@gasston Hello it managed to hide the top text which is great! But how can I also hide the contact form?

Screenshot 2021-07-11 201207.png

0 Likes
gasston
Explorer
38 8 16

This is an accepted solution.

Hello @Buddings 

Change the code with this : 

$( document ).ready(function() {
    if($('.contact__success').text()!==undefined && $('.contact__success').text()!==''){
      $('.contact__content .contact__text').hide();
      $('#contact_form input , #contact_form textarea, #contact_form button').hide();
}
});

 If helpful then please Like and Accept Solution.

Thx

Belgacem Ben ltaif
Web consultant /Shopify Expert/ Founder @Funkydev.io
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
https://benltaif.dev
https://funkydev.io/
Buddings
Excursionist
37 1 3

@gasston Yes it worked thank you!