Forcing Thread Icon Selection?

Status
Not open for further replies.

crossfittn

Afro Blue
Feb 4, 2007
1,135
8
0
TN
topyc.io
How did you guys do the javascript pop-up that forces users to select a thread icon?

I found a mod in vb.org that did something similar, but it's useless because it lets the user type up their post, submit it and then gives them an error. So they hit the back button and the post is gone.

SO what javascript do I use to do this?

Thank you!
 


Code:
/* Here is the "post new thread" form */
<form action="newthread.php?do=postthread&f=5" method="post" name="vbform" onsubmit="var i = 0;if(document.vbform.iconid[0].checked == true) { i = 1; } if(document.vbform.iconid[1].checked == true) { i = 1;} if(document.vbform.iconid[2].checked == true) { i = 1; } if(document.vbform.iconid[3].checked == true) { i = 1; } if(document.vbform.iconid[4].checked == true) { i = 1; } if(document.vbform.iconid[5].checked == true) { i = 1; } if(document.vbform.iconid[6].checked == true) { i = 1; } if(document.vbform.iconid[7].checked == true) { i = 1; } if(document.vbform.iconid[8].checked == true) { i = 1; } if(document.vbform.iconid[9].checked == true) { i = 1; } if(document.vbform.iconid[10].checked == true) { i = 1; } if(document.vbform.iconid[11].checked == true) { i = 1; } if(document.vbform.iconid[12].checked == true) { i = 1; } if(document.vbform.iconid[13].checked == true) { i = 1; };if(document.vbform.iconid[14].checked == true) { i = 1; };if(document.vbform.iconid[15].checked == true) { i = 1; };if(document.vbform.iconid[16].checked == true) { i = 1; };if(document.vbform.iconid[17].checked == true) { i = 1; };if(document.vbform.iconid[18].checked == true) { i = 1; };if(document.vbform.iconid[19].checked == true) { i = 1; };if(document.vbform.iconid[20].checked == true) { i = 1; };if(document.vbform.iconid[21].checked == true) { i = 1; };if(document.vbform.iconid[22].checked == true) { i = 1; };if(document.vbform.iconid[23].checked == true) { i = 1; };if(document.vbform.iconid[24].checked == true) { i = 1; };if(document.vbform.iconid[25].checked == true) { i = 1; };if(document.vbform.iconid[26].checked == true) { i = 1; };if(document.vbform.iconid[27].checked == true) { i = 1; };if(document.vbform.iconid[28].checked == true) { i = 1; };if(document.vbform.iconid[29].checked == true) { i = 1; };if(document.vbform.iconid[30].checked == true) { i = 1; };if(document.vbform.iconid[31].checked == true) { i = 1; }if(document.vbform.iconid[32].checked == true) { i = 1; }if(document.vbform.iconid[33].checked == true) { i = 1; }if(document.vbform.iconid[34].checked == true) { i = 1; }if(document.vbform.iconid[35].checked == true) { i = 1;
}if(document.vbform.iconid[36].checked == true) { i = 1;  }

if (i == 0) { alert('You must enter an icon!'); return false };return vB_Editor['vB_Editor_001'].prepare_submit(this.subject.value, 4);"> 
/* ------------------------------------*/
/* Here is an example of one of the icons */
<input type="radio" name="iconid" value="28" id="rb_iconid_28" tabindex="1" onclick="swap_posticon('pi_28')"  />
 
Thanks Kurt!

So, I set up my own iconids in there, right? Does that mean I bypass the whole vbulletin system?
I'm totally new to this and don't know much about the vbulletin software.
Sorry..

How do I set this up for my own site?

Ian
 
Status
Not open for further replies.