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 ] Topic Title for Flexible Form Script
Topic Started: Jul 30 2015, 06:17 AM (376 Views)
JamieMN
Member
[ *  *  * ]
Board Address: w11.zetaboards.com/modernnationsrpg
Board Software: ZetaBoards
Description:

I'm wanting the topic title for when people do the flexible form script to actually contain information from one of the questions, how could I do it?

I want the topic title to be the ticket ID.

Code:
 
<form id='generic_form'>
<div class='category'>
<table class='cat_head'>
<tr>
<td><h2 style='text-align:center'>Modern Nations Support Ticket</h2></td>
</tr>
</table>
</div>

<table>
<tr>
<td> </td>
</tr>
</table>

<table id='form_spec'>
<tr>
</h2></th>
</tr>
<tr id="ticket">
<td><b><font color="lime">Your Ticket ID:</font></b?></td>
<td><input type='text' readonly /></td>
</tr>
<tr>
<td><b><font color="lime">Ticket Type:</b></font></td>
<td>
<select>
<option>Technical Issue</option>
<option>Roleplay Dispute</option>
<option>Other</option>
</select>
</td>
</tr>
<tr>
<td><b><font color="lime">Account Name:</b></font></td>
<td><input type='text' /></td>
</tr>
<tr>
<td><b><font color="lime">Who is involved?:</b></font></td>
<td><input type='text' /></td>
</tr>
<tr>
<td><b><font color="lime">Description:</b></font><br><I>(Include Links to any topics it involves)</I></td>
<td><textarea rows='20'></textarea></td>
</tr>
<tr>
<td colspan='2' id='send_form'><button type='submit'>Submit Ticket</button></td>
</tr>
</table>

</form>

<style type='text/css'>
/* <![CDATA[ */
#form_spec tr td:first-child {
font-weight: bold;
width: 30%;
}
#form_spec input, #form_spec textarea {
width: 500px;
}
/* ]]> */
</style>

<script type='text/javascript'>
var form_script = {
form_id: $('#generic_form'),
status_id: $('#send_form'),
specific_id: $('#form_spec'),
enable_guests: false,
pm: {
enabled: false, // Does not work for guests
user: "Reid", // 1 user only
title: "New Form From {{user_name}}",
content: "{{form}}"
},
topic: {
enabled: true,
forum_id: 4219303, // 1 id only
title: "{{ticket}} - Support Ticket",
description: "",
content: "{{form}}"
},
statuses: {
not_logged_in: "You must be registered and signed in to use this feature.", // Used if enable_guests: false
first: "Collecting Data...",
second: "Sending Ticket...",
done: "Form Sent! You will be contacted by a member of Staff after the ticket has being reviewed."
},
submission_formatting: {
separator: ' ',

before_all: '',
after_all: '',

before_question: '[b]',
after_question: '[/b]',

before_response: '[i]',
after_response: '[/i]'
},
possible_elements: 'input, textarea, select' // For the second column of table; .val() must work on it
};
</script>

<script type='text/javascript' src='http://z3.ifrm.com/313/104/0/p366373/form_script.js'></script>



In the "type" of ticket, it doesn't actually show up on the form when it's submitted either, is there an issue I've done when adding that question? Would it also be possible to include the ticket ID in the form once submitted too.
Edited by JamieMN, Jul 30 2015, 05:13 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
var ticketID = $('#ticket input').val();
Place that below the starting script tag.
Code:
 
" + ticketID + "
Place that inside the quotation marks for the title variable.
Offline Profile Goto Top
 
JamieMN
Member
[ *  *  * ]
Not sure if I've misunderstood or something, but when I submit a form nothing appears.

Code: Modified
 
<form id='generic_form'>
<div class='category'>
<table class='cat_head'>
<tr>
<td><h2 style='text-align:center'>Modern Nations Support Ticket</h2></td>
</tr>
</table>
</div>

<table>
<tr>
<td> </td>
</tr>
</table>

<table id='form_spec'>
<tr>
</h2></th>
</tr>
<tr id="ticket">
<td><b><font color="lime">Your Ticket ID:</font></b?></td>
<td><input type='text' readonly /></td>
</tr>
<tr>
<td><b><font color="lime">Ticket Type:</b></font></td>
<td>
<select>
<option>Technical Issue</option>
<option>Roleplay Dispute</option>
<option>Other</option>
</select>
</td>
</tr>
<tr>
<td><b><font color="lime">Account Name:</b></font></td>
<td><input type='text' /></td>
</tr>
<tr>
<td><b><font color="lime">Who is involved?:</b></font></td>
<td><input type='text' /></td>
</tr>
<tr>
<td><b><font color="lime">Description:</b></font><br><I>(Include Links to any topics it involves)</I></td>
<td><textarea rows='20'></textarea></td>
</tr>
<tr>
<td colspan='2' id='send_form'><button type='submit'>Submit Ticket</button></td>
</tr>
</table>

</form>

<style type='text/css'>
/* <![CDATA[ */
#form_spec tr td:first-child {
font-weight: bold;
width: 30%;
}
#form_spec input, #form_spec textarea {
width: 500px;
}
/* ]]> */
</style>

<script type='text/javascript'>
var ticketID = $('#ticket input').val();
var form_script = {
form_id: $('#generic_form'),
status_id: $('#send_form'),
specific_id: $('#form_spec'),
enable_guests: false,
pm: {
enabled: false, // Does not work for guests
user: "Reid", // 1 user only
title: "New Form From {{user_name}}",
content: "{{form}}"
},
topic: {
enabled: true,
forum_id: 4219303, // 1 id only
title: "" + ticketID + "",
description: "",
content: "{{form}}"
},
statuses: {
not_logged_in: "You must be registered and signed in to use this feature.", // Used if enable_guests: false
first: "Collecting Data...",
second: "Sending Ticket...",
done: "Form Sent! You will be contacted by a member of Staff after the ticket has being reviewed."
},
submission_formatting: {
separator: ' ',

before_all: '',
after_all: '',

before_question: '[b]',
after_question: '[/b]',

before_response: '[i]',
after_response: '[/i]'
},
possible_elements: 'input, textarea, select' // For the second column of table; .val() must work on it
};
</script>

<script type='text/javascript' src='http://z3.ifrm.com/313/104/0/p366373/form_script.js'></script>
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
A few things I'm noticing: If the 'Your Ticket ID:' input doesn't have a value, the form won't be submitted since there's no topic title. Secondly, you need to use this code if you want to insert HTML into the table cells.
Code: HTML
 
</h2></th>
That's also an HTML error.
Offline Profile Goto Top
 
JamieMN
Member
[ *  *  * ]
Thanks Cory!
Request is complete. ^^
Offline Profile Goto Top
 
Roby
Member Avatar
#27

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