|
Viewing Single Post From: Add Extra Field to Post
|
|
Viral
|
Feb 9 2008, 01:36 PM
|
- Posts:
- 1,374
- Group:
- Members
- Member
- #269
- Joined:
- Dec 1, 2007
- What Browser are you using?
- Chrome
- ZB Board URL
- http://s1.zetaboards.com/zeta_services
|
This will add an extra field when making a new topic in a designated forum. The info will be added to the end of the post.
- Code: HTML
-
<script> //<![CDATA[ /* Extra field on topic display by Viral of http://www.moregfx.com/index.php http://www.zetaresources.com */ forumnumber=9936; extrafieldname="Source"; errormsg="Unfortunately, you did not fill out the "+extrafieldname+" field!"; if(location.href.match(forumnumber)){ $(function(){ $("tr:contains('Topic Tags')").before("<tr><td class='c_desc'>"+extrafieldname+":</td><td><input type='text' autocomplete='off' tabindex='2' value='' name='source' size='40' id='source'/></td></tr>"); }); buttons=document.getElementsByTagName('button'); for(i=0;i<buttons.length;i++){ if(buttons[i].name=="post_submit"){ buttons[i].onclick=function(){ a=document.getElementsByTagName('textarea')[0]; source=document.getElementById('source'); if(source.value.length<=0){alert(errormsg);return false;} else { a.value+="\nSource: [i]"+source.value+"[/i]"; }}}}} //]]> </script>
Edit: forumnumber=number of forum here; extrafieldname="Name of the xtra field"; errormsg="If the field is not filled out, this will pop up!";
Have fun.
Edited by Viral, Feb 10 2008, 02:02 PM.
|
|
|