Hiya,
I’m trying to modify the following code. Right now it creates a slider to post a rating. I want to use single-click buttons that, when clicked, will set a value and submit the form.
HERES THE OLD CODE:
[code=html]
<script type=”text/javascript” language=”javascript”>
<!–
new Control.Slider(‘handle1′,’track1′,{ startSpan:’span1′, range:$R(1,10),
values:[1,2,3,4,5,6,7,8,9,10],
onSlide:function(v) {
document.rate_media.rating.value = v;
}
});
–>
</script>
<form name=”rate_media” action=”process.php” method=”post”>
<input type=”hidden” id=’rating’ name=”rating” value=”1″ />
<input class=”button” type=”submit” name=”rate_media” value=”Submit Rating” />
</form>
HERES THE NEW CODE:
[code=html]
<script language=”JavaScript” type=”text/javascript”>
<!–
function sendrating(v)
{
document.rate_media.rating.value = v;
document.rate_media.submit() ;
}
–>
</script>
<form name=”rate_media” action=”process.php” method=”post”>
<input type=”hidden” id=’rating’ name=”rating” value=”1″ />
<a href=”javascript:sendrating(‘1’)”>Rate it 1</a>
</form>
For some reason my new code isn’t working. Any ideas?? I’ve been working on it for hours, so any help would be GREAT!