Insert buttons in public registration forms
You should use Smarty:

According to the CiviCRM Javascript Reference, public-facing pages should follow the principle of Progressive Enhancement.

"Front-facing pages like contribution pages and event signups should adhere to the standards of PE. All front-end pages should be fully functional with js disabled."