Keyword

K2 in frontend replace save and close button to input submit

  • Michael Gulyaev
  • Michael Gulyaev's Avatar Topic Author
  • Offline
  • New Member
More
3 years 11 months ago #175871 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.

More
3 years 10 months ago #175875 by JoomlaWorks
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
  • Michael Gulyaev's Avatar Topic Author
  • Offline
  • New Member
More
3 years 10 months ago #175887 by Michael Gulyaev
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.

More
3 years 10 months ago #175904 by JoomlaWorks
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

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
  • Michael Gulyaev's Avatar Topic Author
  • Offline
  • New Member
More
3 years 10 months ago #175915 by Michael Gulyaev
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"?

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #175934 by JoomlaWorks
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.


Powered by Kunena Forum