Jump to content

Create a New Submit button and hide the original one from my Submission Form


Recommended Posts

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>

Screenshot_1.png.1d90bcc437b1a88f7ce34f83bc0280b0.png

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?

Link to comment
Share on other sites

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>

Screenshot_2.png.0f21c97a7d6bf8c4e5ee4931824be61b.png

 

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

 

Link to comment
Share on other sites

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>

Screenshot_2.png.0f21c97a7d6bf8c4e5ee4931824be61b.png

 

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

 

 
Link to comment
Share on other sites

  • 4 years later...

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>

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...