Thanks for the new direction, though I wasn't able to get it to work
yet. I am not getting anything back. The php file I have now is just
echoing out "1" if sendcode equals some
session variable I have. But it's not echoing anything back onto the
screen, and nothing happens. :\ And I know the session variable is
correct.
Here is the function, any ideas?:
function codeCheck(){
sendcode = document.getElementById('code').value;
new Ajax.request('randy.php',{
method: 'post',
postBody: escape('id='+sendcode),
onSuccess: function(t){
var test = $('testdiv');
if(t.responseText == '1')
test.innerHTML='Correct';
},
onFailure: function(t) {
alert('Error ' + t.status + ' -- ' + t.statusText);
},
on404: function(t) {
alert('Error 404: location "' + t.statusText + '" was not
found.');
}
});
}
php file is something like:
if(isset($_POST['id'])){
$id=$_POST['id'];
if ($id == $compare){
echo "1";
} else {
echo "0";
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---