change content of submit button
Permalink 3 users found helpful
I am attempting to change the content of a submit button I am using for a contact form
I can access inspect element for the form, and locate the html and div post, etc, but whenever I try to make my changes, in the value field i cannot make it stick.
Please, how do I make and save my changes to my submit button in my contact form???
Any suggestions on my issue would be greatly appreciated.
Thx
Mike
I can access inspect element for the form, and locate the html and div post, etc, but whenever I try to make my changes, in the value field i cannot make it stick.
Please, how do I make and save my changes to my submit button in my contact form???
Any suggestions on my issue would be greatly appreciated.
Thx
Mike
i run concrete5 Version 5.6.0 and just managed to change the 'submit' button text :)
*)Open [webserver]/concrete5/concrete/core/controllers/blocks/form_minisurvey.php
*)Edit line 186:
*)Save
Greets
*)Open [webserver]/concrete5/concrete/core/controllers/blocks/form_minisurvey.php
*)Edit line 186:
echo '<tr><td> </td><td><input class="formBlockSubmitButton ccm-input-button" name="Submit" type="submit" value="'.t('Submit').'" /></td></tr>';
*)Save
Greets
Is there any way to change the wording in a theme?
for me the much cleaner way ist to you the Form Tableless Layout Add-On:
http://www.concrete5.org/marketplace/addons/form-tableless-layout/...
In line 74 you can add your word for Submit.
And because it is in a view file you can customize it much better!
http://www.concrete5.org/marketplace/addons/form-tableless-layout/...
In line 74 you can add your word for Submit.
And because it is in a view file you can customize it much better!
Thanks...
thanks! :)
I found another dirty way, but less dirty since you don´t need to edit the controller core code:
Just add this javascript to the header of the page that has the submit button:
You just need to locate precisely where the input is, if you just set $('input[type="submit"]' it will change the name of all submit buttons in your page (in case you have more than one).
This way you can assign even different names to different buttons in same page, just matching the precise inputs and using different variables
If you add this code to the default.php page it will be used anytime you create a new page and include a new form.
Sorry for my english if you don´t understand something. It´s not my primary language.
Greets
Just add this javascript to the header of the page that has the submit button:
$(document).ready(function(){ //here we set the value text var inputValue = "YourSubmitText"; //here we assign your name to the value of the input $('#YourDivID input[type="submit"]').attr("value", inputValue); });
You just need to locate precisely where the input is, if you just set $('input[type="submit"]' it will change the name of all submit buttons in your page (in case you have more than one).
This way you can assign even different names to different buttons in same page, just matching the precise inputs and using different variables
If you add this code to the default.php page it will be used anytime you create a new page and include a new form.
Sorry for my english if you don´t understand something. It´s not my primary language.
Greets
This worked like a charm on my site. I added it to the Header Extra Content under Properties on the page with my form and was able to change the submit button text.
As of version 5.6 there are three correct ways to do that with core functionality.
One is to add another language and put a translation in it.
Second one is when you don't worry about people without JS - then a script changing submit button text (value) is OK.
Third one is to take concrete/blocks/form/controller.php and copy it to blocks/form/controller.php. Then take method loadSurvey from concrete/core/controllers/blocks/form_minisurvey.php and copy it to MiniSurvey class in blocks/form/controller.php so it will be an override and then change one line of code in it:
That way even when you update C5 it will not overwrite your change and you don't touch the core.
One is to add another language and put a translation in it.
Second one is when you don't worry about people without JS - then a script changing submit button text (value) is OK.
Third one is to take concrete/blocks/form/controller.php and copy it to blocks/form/controller.php. Then take method loadSurvey from concrete/core/controllers/blocks/form_minisurvey.php and copy it to MiniSurvey class in blocks/form/controller.php so it will be an override and then change one line of code in it:
echo '<tr><td> </td><td><input class="formBlockSubmitButton ccm-input-button" name="Submit" type="submit" value="'.t('Submit').'" /></td></tr>';
That way even when you update C5 it will not overwrite your change and you don't touch the core.
All these ways seem overly complicated when we just want to change the text of that button... so I've posted a feature suggestion.https://www.concrete5.org/community/forums/5-7-discussion/feature-re...
If you think good idea, can you show your support in this thread? Thanks :)
If you think good idea, can you show your support in this thread? Thanks :)
Works perfectly for me! Finally a solution!!! Many thanks, Thenine.
The better way would be though to set up a language file I guess.