We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] [ C ] Multiple choice for Topic Description
Topic Started: Oct 16 2017, 06:46 PM (333 Views)
Harvyy
Member Avatar
Member
[ *  *  * ]
Private
Zetaboard
Description: I have a social section on my forum that holds sub-forums for each topic such as sports, games, television, news, and music, to be discussed. I don't like the long text users enter in the description for their topic; it makes the forum look messy. I would like a code that transforms the topic description into a drop menu with multiple choice. Multiple choices that are unique to that sub-forum; so the choices in the games forum would be different for the choices in the music forum.

If not possible, I would like something similar to zetaboard support forum's topic suggestion drop menu. Something like this but made for topic description and not topic.

Posted Image
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
$(function() {
var enabledIn = ['FORUM_ID', 'FORUM_ID', 'FORUM_ID'];

for (var i = 0; i < enabledIn.length; i++) {
if (location.href.indexOf('?type=1&mode=1&f=' + enabledIn[i]) !== -1 || location.href.indexOf('?mode=3&type=1&f=' + enabledIn[i]) !== -1) {
$('input[name="description"]').hide().after('<select name="mc_desc"></select>');
}
}

$('form[name="posting"]').submit(function() {
var oInput = $('select[name="mc_desc"] option:selected').val();
$('input[name="description"]').val(oInput);
});

function addOption(fID, oTitle) {
if (location.href.indexOf('?type=1&mode=1&f=' + fID) !== -1 || location.href.indexOf('?mode=3&type=1&f=' + fID) !== -1) {
$('select[name="mc_desc"]').append('<option>' + oTitle + '</option>');
}
}

addOption('FORUM_ID', 'OPTION_TITLE');
addOption('FORUM_ID', 'OPTION_TITLE');
addOption('FORUM_ID', 'OPTION_TITLE');
});
//]]>
</script>
Edit the capitlized text near the top and bottom.
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
Thank you.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

This request has been re-opened upon Harvyy's request.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
What can I re-assist you with, Harvyy?
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
I noticed that topics' description in other sections I did not use this code for are disappearing whenever i edit said topic or create a new topic with a description ( it just doesn't show). For example, if I go edit a topic from yesterday that had a topic description, it disappears. Here are images of what I am talking about. Below shows an example of a topic my friend created today with a description and what happens when he post the topic? topic's description disappears.

Posted Image

Posted Image

Posted Image
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try this instead:
Code:
 
<script type="text/javascript">
//<![CDATA[
$(function() {
var enabledIn = ['FORUM_ID', 'FORUM_ID', 'FORUM_ID'];

for (var i = 0; i < enabledIn.length; i++) {
if (location.href.indexOf('?type=1&mode=1&f=' + enabledIn[i]) !== -1 || location.href.indexOf('?mode=3&type=1&f=' + enabledIn[i]) !== -1) {
$('input[name="description"]').hide().after('<select name="mc_desc"></select>');

$('form[name="posting"]').submit(function() {
var oInput = $('select[name="mc_desc"] option:selected').val();
$('input[name="description"]').val(oInput);
});
}
}

function addOption(fID, oTitle) {
if (location.href.indexOf('?type=1&mode=1&f=' + fID) !== -1 || location.href.indexOf('?mode=3&type=1&f=' + fID) !== -1) {
$('select[name="mc_desc"]').append('<option>' + oTitle + '</option>');
}
}

addOption('FORUM_ID', 'OPTION_TITLE');
addOption('FORUM_ID', 'OPTION_TITLE');
addOption('FORUM_ID', 'OPTION_TITLE');
});
//]]>
</script>
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
The code is working properly now, thanks.
Edited by Harvyy, Dec 1 2017, 04:33 PM.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic