Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
minimum characters required to post
Topic Started: Dec 13 2007, 11:57 AM (1,078 Views)
Godkillah
Member
[ * ]
simply disables posting if the post does not have enough characters

Original Request: http://phantom-designs.net/index.php?showtopic=11573

Add anywhere under the board
Quote:
 
<script type="text/javascript">
//<![CDATA[
/*minimum characters per post
by godkillah from phantom-designs.net*/

var MinimumCharacters=15
var Message="Your post requires at least 15 characters"

if(location.href.match(/\/post\//i)){
document.forms.posting.onsubmit=function(){
characters=document.forms.posting.post.value.length
if(characters<MinimumCharacters){
alert(Message)
return false
}else{
return true
}}}
//]]>
</script>

edit what is red, should be pretty much selfexplaining,
enjoy
Edited by Nicola, Dec 19 2007, 11:42 AM.
Offline Profile Quote Post Goto Top
 
DynamicIP
Member Avatar
I'm known as Nor
[ *  * ]
hehe sup Gk, nice code :P.

Also remove the else statement to make your script shorter, it will return true regardless..
Edited by DynamicIP, Dec 13 2007, 12:30 PM.
Offline Profile Quote Post Goto Top
 
Godkillah
Member
[ * ]
thanks, yeah i know.
this basically is my old IF code but than changed the little words :P
whas to lazy to change more
Offline Profile Quote Post Goto Top
 
DynamicIP
Member Avatar
I'm known as Nor
[ *  * ]
lol i hear you.
Offline Profile Quote Post Goto Top
 
flash
Member Avatar
Member
[ *  * ]
Nice code!
I may use this, to stop one word posts of things like 'lol' :P
Offline Profile Quote Post Goto Top
 
chiodos
Member Avatar
zetaboards.com/yoshi
[ *  * ]
Where to put this?
Offline Profile Quote Post Goto Top
 
DynamicIP
Member Avatar
I'm known as Nor
[ *  * ]
Quote:
 
Insert code in Themes->Board template->Below the Board
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
You may want to use the following:

if(location.href.match(/topic/)){}

Your code would most likely do the same for the editing signature as well.
Offline Profile Quote Post Goto Top
 
DynamicIP
Member Avatar
I'm known as Nor
[ *  * ]
? This is for editing the signature[lol]
Offline Profile Quote Post Goto Top
 
ZapTap
Member Avatar
Member
[ *  *  *  * ]
he already has
if(location.href.match(/\/post\//i)){}
so it should be fine, except that I'm not entirely sure it will work on topics and I'm too lazy to test it
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply