Over a million developers have joined DZone.

CiviCRM change QuickForm Cancel button's value

QuickForm automatically creates the Cancel button as part of the buttons array.  Use this code in the .php controller code if you want to change the HTML value of the button.  Note that the generated HTML uses <input> and not <button>, so the label and the value will be identical.
// Get the buttons array, find the Cancel button, change the label
$new_buttons_obj = $this->getElement('buttons');
foreach ($new_buttons_obj->_elements as $e) {
    if ($e->_attributes['value']=='Cancel') {
        $e->setValue('Cancel and return to previous page');

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}