Override form submit button (contact form)
Permalink 1 user found helpful
Hi guys,
I'd like to give the form submit button at the contact form a different css class (.btn).
The code for the button is placed in
/concrete/core/controllers/blocks/form_minisurvey.php
Any chance to override this? Or any other idea how to change this without hacking the core after every update?
Best regards
Torsten
I'd like to give the form submit button at the contact form a different css class (.btn).
The code for the button is placed in
/concrete/core/controllers/blocks/form_minisurvey.php
Any chance to override this? Or any other idea how to change this without hacking the core after every update?
Best regards
Torsten
Hi lackadaize,
copying the form_minisurvey.php to root/blocks did't work.
Regards
Torsten
copying the form_minisurvey.php to root/blocks did't work.
Regards
Torsten
Make a folder in your root/blocks folder called form, copy the controller.php from root/concrete/blocks/form/ folder and put into your new folder,
Edit the MiniSurvey class as you desire..
Edit the MiniSurvey class as you desire..
class MiniSurvey extends Concrete5_Controller_Block_FormMinisurvey {//edit here }
In Concrete 5.6.2.1
To over-ride the submit function your controller.php should be like this
To over-ride the submit function your controller.php should be like this
<?php defined('C5_EXECUTE') or die("Access Denied."); class FormBlockController extends Concrete5_Controller_Block_Form {} class FormBlockStatistics extends Concrete5_Controller_Block_FormStatistics {} class MiniSurvey extends Concrete5_Controller_Block_FormMinisurvey { function loadSurvey( $qsID, $showEdit=false, $bID=0, $hideQIDs=array(), $showPending=0 ){ //loading questions $questionsRS=$this->loadQuestions( $qsID, $bID, $showPending); if(!$showEdit){ echo '<table class="formBlockSurveyTable">'; while( $questionRow=$questionsRS->fetchRow() ){ if( in_array($questionRow['qID'], $hideQIDs) ) continue; // this special view logic for the checkbox list isn't doing it for me /* if ($questionRow['inputType'] == 'checkboxlist' && strpos($questionRow['options'], '%%') === false){
Viewing 15 lines of 134 lines. View entire code block.
Hi weyboat,
Ok, thats too much PHP for me ;)
Could you please explain a bit more how to edit it.
I'd like to change the button class from
to
Regards
Torsten
Ok, thats too much PHP for me ;)
Could you please explain a bit more how to edit it.
I'd like to change the button class from
<input class="formBlockSubmitButton ccm-input-button" type="submit" value="submit" name="Submit">
to
<input class="formBlockSubmitButton btn" type="submit" value="submit" name="Submit">
Regards
Torsten
Do your edits in the overridden controller as you have demonstrated,
What are you trying to achieve?
What are you trying to achieve?
Sorry, didn't realized that you copied the whole code... of that function ;)
No, Only that one complete function..
Thanks, that works.
I've edited the page_not_found.php at root/concrete/core/controllers/blocks/page_not_found.php before and dropped it into root/single_pages/ without any functionality problems when updating the CMS.