Hi Guys,
I'm new to Jquery. I have a project that has checkboxes and if their status change, then I update some sql table.
But i decided to start with the simple things first to learn how this works...
So, I want to pass to a Jquery function, a php variable if a checkbox status changes.
I have this code:
<?php ?>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
function my_function(var mensagem_id)
{
alert("Sucesso, Mensagem nº: " + mensagem_id);
}
</script>
</HEAD>
<BODY>
<?php
$mensagem_id = "3";
echo $mensagem_id;
?>
<input type='checkbox' name='lida' value='mensagem_id' onchange='my_function($mensagem_id)'/>
</BODY>
</HTML>
But in firebug I keep getting the message (function my_function() not defined)...
Can anyone help me?