PDA

View Full Version : how do i *force* a user to rate when submitting a reply?


212rikanmofo
04-30-2002, 10:39 AM
what template do i edit, and what do i change in order to force a user to select a rating for when they reply to a thread?

Admin
04-30-2002, 10:54 AM
Edit newreply_ratethread template and removed this:
<option value="0"$rate[0]>Select a rating (optional)</option>
And it might even work! :)

BTW, you might want to replace this:
<option value="3"$rate[3]>3 .. Average</option>
With this:
<option value="3"$rate[3]$rate[0]>3 .. Average</option>
So Average will be selected by default.

212rikanmofo
04-30-2002, 11:25 AM
doesnt work :(

you know when you goto REPLY to a thread, it has a pulldown box to let you select 1 -5? well if a user doesnt select anything, how do you make it popup a window and say "Please rate this before submitting"? in other words the user is forced to select a rating, if he doesn't then a popup window will prompt the user to rate it, kind of like a required field... thats what i want to do.

Admin
04-30-2002, 11:28 AM
Works for me.

212rikanmofo
04-30-2002, 11:54 AM
it does? so if you dont select a rating, it will pop up a window and tell you to rate it b4 submitting?

on mine, if i dont select anything, it still submits the post, which i dont want it to...

i want it to popup a window if a user doesnt select a rating, telling him/her to select a rating from the dropdown list b4 he continues.

thats what im trying to do....

Admin
04-30-2002, 11:56 AM
My way just doesn't let users choose the "No Rating" option.

212rikanmofo
04-30-2002, 12:12 PM
do you think you can make it where it pops up a window if a user doesnt select anything from the rating drop down list? do you know how to do it like that please? :(

Admin
04-30-2002, 12:46 PM
Nope.

212rikanmofo
04-30-2002, 12:51 PM
nope you don't know how to do it, or nope you don't want to tell me? please help me out

NTLDR
04-30-2002, 02:28 PM
I think what FireFly means is that you should try to do it yourself instead of asking others to do it all for you.

That way you will learn something.

Admin
04-30-2002, 02:31 PM
...and I also don't know how to do that.

212rikanmofo
04-30-2002, 05:55 PM
<script language="javascript">
<!--
var postmaxchars = $postmaxchars;
function validate(theform) {
if (theform.message.value=="") {
alert("Please complete the message field.");
return false; }
if (postmaxchars != 0) {
if (theform.message.value.length > $postmaxchars) {
alert("Your message is too long.\n\nReduce your message to $postmaxchars characters.\nIt is currently "+theform.message.value.length+" characters long.");
return false; }
else { return true; }
} else { return true; }
}
function checklength(theform) {
if (postmaxchars != 0) { message = "\nThe maximum permitted length is $postmaxchars characters."; }
else { message = ""; }
alert("Your message is "+theform.message.value.length+" characters long."+message);
}
//-->
</script>


i know it has something to do with this part of the newreply template, the thing is i don't know how to add it in, it checks to see if the user has selected a rating or not, and if not, it will pop up a window to tell him to please rate the thread, if not it wont submit the post.... thats what im looking for.... anyone know how to edit this part to do that?

Atian
05-03-2002, 05:26 PM
shoulnt you just make something like


if $action=no_rating
popup=<var=popup message=Please select a rating!>
else {
else if $rating $selected
echo <p>thanks,you will now be taken to the index</p> ;


i think im wrong,i really dont know,i thnik its something liek that...