Watusi Posted February 26, 2019 Report Share Posted February 26, 2019 I would like to hide the Submit button on my Submission Form and create a new submit button in my website where the DataPage is deployed. I was able to hide the Submit button on my Submission Form by adding an HTML block and using this code: <style> .cbSubmitButton{ display: none !important; } </style> Meanwhile, on my website, I used the following code for the new Submit button: <input type="submit" name="Submit" value="Submit" class="newSBstyle"> Unfortunately, this new Submit button doesn't work. I'm thinking that I'm missing some JavaScript code for my Submission Form to be submitted upon clicking my new Submit button. Does anyone know how to do this? Quote Link to comment Share on other sites More sharing options...
AtayBalunbalunan Posted February 26, 2019 Report Share Posted February 26, 2019 Hi Watusi, if you have just one DataPage deployed in your website page, you can add this script in your DataPage's Footer: <script type="text/javascript"> function submitCBForm() { document.getElementById("caspioform").submit(); } </script> Then, add onclick="submitCBForm()" in your new Submit button to execute the script for submitting the form. Your new button's code can look like this: <input type="submit" name="Submit" value="Submit" class="newSBstyle" onclick="submitCBForm()"> Watusi and ReeganAnne 1 1 Quote Link to comment Share on other sites More sharing options...
Watusi Posted February 26, 2019 Author Report Share Posted February 26, 2019 Thank you, AtayBalunbalunan. This solution works. 18 minutes ago, AtayBalunbalunan said: Hi Watusi, if you have just one DataPage deployed in your website page, you can add this script in your DataPage's Footer: <script type="text/javascript"> function submitCBForm() { document.getElementById("caspioform").submit(); } </script> Then, add onclick="submitCBForm()" in your new Submit button to execute the script for submitting the form. Your new button's code can look like this: <input type="submit" name="Submit" value="Submit" class="newSBstyle" onclick="submitCBForm()"> Quote Link to comment Share on other sites More sharing options...
IamNatoyThatLovesYou Posted May 20 Report Share Posted May 20 Hello Everyone, just sharing a code that may be useful for this conversation. This hides the submit button when clicked/pressed. <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { var subbutton= document.querySelector(".cbSubmitButton"); subbutton.unsafe = function() { subbutton.style.display = "none"; }; }); </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.