I am looking for a solution to hide my html form contents and only display the "Thank You for your submission" text in the same landing page after the submit button is clicked.
My code will perform the following operations:
- Retrieve sales cloud object field records
- Pre-populate the sales cloud fields in the html form (e.g. Name, Email) based on ContactId.
- In addition to those pre-populated fields, the HTML form will have radio buttons for user to select "Attending" or "Not Attending" and lastly a "Submit" button.
- Capture the responses from user, pass it back to sales cloud and show the "Thank you for your submission" text in the landing page.
Can someone show me another simple example on how the form can be hidden? I tried using html script as below, but the form is still not hidden after the submit button is clicked.
<script>
function showHideShipInfo(){
if(document.getElementbyId('submit1').submit){
document.getElementById('formfieldsetid').style.display='none';
}
else {
document.getElementById('formfieldsetid').style.display='block';
}
}
Note: my html code for the submit button is as follows:
input type ="submit" value="Submit" id=submit1 onclick="showHideShipInfo()"