|
[ C ] Topic Title for Flexible Form Script
|
|
Topic Started: Jul 30 2015, 06:17 AM (376 Views)
|
|
JamieMN
|
Jul 30 2015, 06:17 AM
Post #1
|
- Posts:
- 200
- Group:
- Members
- Member
- #203,295
- Joined:
- December 12, 2011
- My Board URL
- www.modernnations.com
|
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.
|
|
|
| |
|
Cory
|
Jul 30 2015, 05:35 PM
Post #2
|
- Posts:
- 16,587
- Group:
- Members
- Member
- #44,593
- Joined:
- February 12, 2005
|
- 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.
|
|
|
| |
|
JamieMN
|
Jul 31 2015, 03:04 AM
Post #3
|
- Posts:
- 200
- Group:
- Members
- Member
- #203,295
- Joined:
- December 12, 2011
- My Board URL
- www.modernnations.com
|
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>
|
|
|
| |
|
Cory
|
Jul 31 2015, 09:01 AM
Post #4
|
- Posts:
- 16,587
- Group:
- Members
- Member
- #44,593
- Joined:
- February 12, 2005
|
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.
|
|
|
| |
|
JamieMN
|
Aug 21 2015, 07:19 AM
Post #5
|
- Posts:
- 200
- Group:
- Members
- Member
- #203,295
- Joined:
- December 12, 2011
- My Board URL
- www.modernnations.com
|
Thanks Cory! Request is complete. ^^
|
|
|
| |
|
Roby
|
Aug 22 2015, 02:00 AM
Post #6
|
#27
- Posts:
- 2,547
- Group:
- Support Team
- Member
- #161,589
- Joined:
- October 20, 2007
- I'm Browsing With
- Firefox
|
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.
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|