Keyword

K2 in frontend replace save and close button to input submit

  • Michael Gulyaev
  • Michael Gulyaev's Avatar Topic Author
  • Offline
  • New Member
More
4 months 2 hours 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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 months 4 weeks ago #175875 by Fotis
Any practical reason to do that?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Michael Gulyaev
  • Michael Gulyaev's Avatar Topic Author
  • Offline
  • New Member
More
3 months 4 weeks 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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 months 4 weeks ago #175904 by Fotis
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

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Michael Gulyaev
  • Michael Gulyaev's Avatar Topic Author
  • Offline
  • New Member
More
3 months 4 weeks 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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 months 3 weeks ago #175934 by Fotis
Remove that and simply place an <input type="submit"... /> button before the closing </form> tag.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum