Solved

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

Buddings
Excursionist
45 1 6

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

Accepted Solution (1)
Uncle_ben
Shopify Partner
51 10 17

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/

View solution in original post

Replies 4 (4)

Uncle_ben
Shopify Partner
51 10 17

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/
Buddings
Excursionist
45 1 6

@Uncle_ben 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

Uncle_ben
Shopify Partner
51 10 17

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
45 1 6

@Uncle_ben Yes it worked thank you!