I've got a photo rating module for joomla. The consumer chooses among the radio buttons that corresponds using the value, and so the value should be posted towards the database however it is not being posted its just posting a zero rather regardless of what the worthiness.

    function getCheckedRadio(radio_group) 
{
    for (var i = 0; i < radio_group.length; i++) 
    {
        var button = radio_group[i];
        if (button.checked) 
        {
            return button;
        }
    }
    return undefined;
}

    function submitVote()
{

var form = document.rateForm;
var checkedButton = getCheckedRadio(document.rateForm.elements.numbervote);
if (checkedButton) 
{
    selectedvalue = checkedButton.value;
}

        if(selectedvalue=='')
    {
    document.getElementById('numbervoteErr').style.display='block';
    return false;
}else if(!isInteger(selectedvalue)){
    document.getElementById('numbervoteErr').style.display='block';
    return false;
}else if(selectedvalue > 10){
    document.getElementById('numbervoteErr').style.display='block';
    return false;
}
else
    {
    chck();
}

    function chck(){
                            xmlhttpPost("<?php echo JURI::root(); ?>modules/mod_image_ratting/saverate.php");
                        }
                        function updatepage(str){
                            document.getElementById("load").innerHTML =  str;
                            document.getElementById("load").style.visibility = "visible";
                        }


$config = new JConfig;
$options = array();
$options['host'] = $config->host;
$options['user'] = $config->user;
$options['password'] = $config->password;
$options['database'] = $config->db;
$options['prefix'] = $config->dbprefix;
$options['select'] = true;


$db = new JDatabaseMySQL($options);

//$user = JFactory::getUser();
$userId = 0;
//($user->id > 0) ? $user->id : 0;
$numbervote = $_REQUEST['w'];
$folder = $_REQUEST['w2'];
$name = $_REQUEST['w1'];
    $date = date('Y-m-d H-i-s');
    $sql = "INSERT INTO jos_image_ratetting (id,userid,datecreated,value,filename,folder,md5name) VALUES(NULL,'".$userId."','".$date."','".$numbervote."','".$name."','".$folder."',MD5('".$name."'))";
    $db->setQuery($sql);
    if($db->query()){
        $msg = "Thanks for rate!";
    }else{
        $msg = mysql_error();
    }
    echo $msg;