- Posts: 3
COMMUNITY FORUM
[SOLVED] Tagging Required
- junpan
- Topic Author
- Offline
- New Member
Less
More
10 years 9 months ago - 10 years 9 months ago #122352
by junpan
[SOLVED] Tagging Required was created by junpan
Hai, all
i was traying to set tagging input to mandatory field. but no luck , any one can help me to do that
thx.
i was traying to set tagging input to mandatory field. but no luck , any one can help me to do that
thx.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #122353
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Tagging Required
Unfortunately there is no built-in functionality for this.
You can however use a K2 plugin for the backend (which serves or override K2.js) or override itemform.php in the frontend.
More on overriding can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
You can however use a K2 plugin for the backend (which serves or override K2.js) or override itemform.php in the frontend.
More on overriding can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- junpan
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
10 years 9 months ago #122354
by junpan
Replied by junpan on topic Re: Tagging Required
Hi Krikor, thx for your replay,
i was try to follow the same k2 to set mandatory field, added id =Tags on tag input
code :
else if (\$K2.trim(\$K2('#Tags').val()) == '') {
alert( '".JText::_('K2_ITEM_MUST_HAVE_A_TITLE', true)."' );
}
its work when i type some tag then click save , but when type tag and press enter then save the article its not working :(, can you tell me where k2 save the tag value.
Thanks,
Jun
i was try to follow the same k2 to set mandatory field, added id =Tags on tag input
code :
else if (\$K2.trim(\$K2('#Tags').val()) == '') {
alert( '".JText::_('K2_ITEM_MUST_HAVE_A_TITLE', true)."' );
}
its work when i type some tag then click save , but when type tag and press enter then save the article its not working :(, can you tell me where k2 save the tag value.
Thanks,
Jun
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #122355
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Tagging Required
You should check the length of the tag list.
Something like this will do the trick
Something like this will do the trick
// ...
else if ( $K2('.addedTag').length == 0 ) {
alert('Tagging is mandatory');
}
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- junpan
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
10 years 9 months ago #122356
by junpan
Replied by junpan on topic Re: Tagging Required
hi Hi Krikor , thx for your trick .
i try , but the alert not showing, then i try modify the code base on your code, then :) it work.
thx again for your advise.
Thanks,
Jun
i try , but the alert not showing, then i try modify the code base on your code, then :) it work.
thx again for your advise.
Thanks,
Jun
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #122357
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Tagging Required
You 're welcome.
I glad you sorted it out.
I glad you sorted it out.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.