Modify Save button

Hoping someone can help with modifying the "Save" button on an asp page.

The Save and Cancel buttons appear on the page as a default.

I want to keep the buttons on the page. However, I would really like to change the image and text of the Save button.

When the user hits the save button, it does "Save" data. But it also sends an email. The current presentation is confusing to users because it looks like they are "saving" the email when they are actually "Sending" it.

I was thinking about adding a function to the custom content. However, I think I will just add it to the asp page.

My javascript is not that great...so I am not sure how to go about it. I think I need to use getElementsByTagName. However, I am a little lost on how to write it. I know I did not write this correctly...but this was my first stab at it. Am I on the right track? Can someone point me in the right direction or show me the way. Any assistance would be greatly appreciated! Thank you...

<script>
function ModifySaveButton()
{
var button = document.getElementsByTagName('A')[0];
button.getElementsByTagName("?")[0].innerHTML = "Send Email";
}
</script>

  • 0

    Michele

    Is this a system screen you are changing? Or it this an ASP page that you are changing.

    There are different tricks that I would use in different circumstances.

    But basically it is sometimes easier to remove the existing save button and replace it with you own rather than try and modify it.

  • 0

    Right click it,choose 'inspect element' then look at the output in the console. Don't always presume something has an ID however, Sage like to make us work...

  • 0

    Jeff...

    It is an ASP page. I am good with removing the Save button and replacing it with my own. However, I could not figure out how to get at the Save button to hide it.

    Any assistance would be greatly appreciated. Thank you!

  • 0

    Jeff...

    Based on your suggestion, I think I should do something like this...

    document.getElementById("foo").style.display="none";

    However, I don't know how to find it's ID. I think I need some training in using the console..

    If you can let me know if I am on the right track and push me in the right direction, I would appreciate it.

    Thanks!

  • 0

    Thanks! I will give that a try. I am doing a little studying on the DOM right now to get a better understanding of it. I have been through this before...however, I had not looked at much JavaScript at the time. It is making more sense now that I am reviewing it again. It is hard to keep it all straight between SQL, JavaScript and C#. Plus switching back to our old system which is mostly VB. My brain is not big enough..lol.

    Therefore, I greatly appreciated your assistance!