- Posts: 9
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- K2 in frontend replace save and close button to input submit
K2 in frontend replace save and close button to input submit
- Michael Gulyaev
- Topic Author
- Offline
- New Member
Less
More
4 years 6 months ago #175871
by Michael Gulyaev
K2 in frontend replace save and close button to input submit was created by Michael Gulyaev
Hi. Is it possible to replace the standard buttons "save" and "close" in the frontend of K2 with an input type="submit"? What needs to be done for this? Standard replacement does not work. Thanks.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 6 months ago #175875
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 in frontend replace save and close button to input submit
Any practical reason to do that?
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Michael Gulyaev
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
4 years 6 months ago #175887
by Michael Gulyaev
Replied by Michael Gulyaev on topic K2 in frontend replace save and close button to input submit
My idea is to make K2 in the frontend as a form to submit. To check the completion of all necessary fields (name of post, description, etc.) using js validation plugin and to send the post using the input "submit". In this case, the "save" and "close" buttons are inappropriate for use.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 6 months ago #175904
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 in frontend replace save and close button to input submit
Then you'll have to override itemform.php and re-construct the form as you like.
Read this about overriding K2: getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates
Read this about overriding K2: getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Michael Gulyaev
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
4 years 6 months ago #175915
by Michael Gulyaev
Replied by Michael Gulyaev on topic K2 in frontend replace save and close button to input submit
This is all done. The form is completely redone. It remains only now not to save the entered data using the save button, but to send them to the database by the send button. In K2 frontend (in itemform.php) the data is saved by clicking on the tag <a>:
<a href="#" onclick="Joomla.submitbutton('save');return false;">
<i class="fa fa-check" aria-hidden="true"></i> <?php echo JText::_('K2_SAVE'); ?>
</a>
Is it possible to replace this tag <a> with the input button type "submit"?
<a href="#" onclick="Joomla.submitbutton('save');return false;">
<i class="fa fa-check" aria-hidden="true"></i> <?php echo JText::_('K2_SAVE'); ?>
</a>
Is it possible to replace this tag <a> with the input button type "submit"?
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 5 months ago #175934
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 in frontend replace save and close button to input submit
Remove that and simply place an <input type="submit"... /> button before the closing </form> tag.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- K2 in frontend replace save and close button to input submit