In this short blog post on Power Pages, we’ll take a look at how you can update the text on a basic forms submit button for it to say something else.
Identifying the element
Editing the code
Now we need to go to the right place to edit our code in Power Pages. Head to the page where your basic form is and select ‘Edit code’. This will open up your page in Visual Studio Code for the web.
Get the button
Our code will look like this
const submitButton = document.querySelector('#InsertButton')
You can see above the value we need to supply to document.querySelector is simply ‘#’ with the id of our element after the #.
Updating the value
Now we have our button held in a variable, we will be able to use submitButton.value to change the value of our button. Very simply use the following code to update the text inside of your forms submit button.
submitButton.value = "The text you want to display"