View Single Post
Old 06-09-2012, 11:11 AM   PM User | #12
prasunsen
New to the CF scene

 
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
prasunsen is an unknown quantity at this point
Are you still struggling with this? See the code from our "Draw a Robot" app (I'm the creator or RoCanvas):

Code:
function saveRobot(frm)
{
    if(!frm.agree.checked)
    {
        alert("Please accept the distribution terms!");
        frm.agree.focus();
        return false;
    }
    
    var strImageData = canvas.toDataURL();  
        
    $.ajax({
        url: "http://re.trotoys.com/drawarobot/",
        type: "post",
        data: "save=1&pic="+encodeURIComponent(strImageData)+"&robot="+frm.robot.value+"&author="+frm.author.value
            +"&url="+frm.url.value,
        success: function(msg)
        {
           window.location="http://re.trotoys.com/robots/id/"+msg+"/new/1/";
        }
    });
}
In order to have things working you need to pass this.form when calling the function. Perhaps it's best to visit my app and use View source to figure out how it works. I can share the PHP code too if that can help.
prasunsen is offline   Reply With Quote