I have index.php page and I have this there
$pv->showHidden = isset($_POST['showHidden']) ? intval($_POST['showHidden']) : 0;
$pv->sendHidden = isset($_POST['showHidden']) ? 0 : 1;
and then I have this
<input type="image" id="btnShowHidden" src="images/hide.gif" onclick="showHiddenRecords(<?php print $pv->sendHidden; ?>);" />
I have javascript that has this function
function showHiddenRecords(x){
alert(x);
var n = new Object();
var showHidden;
if(x=1){Y=0;} else {Y=1;}
n.showHidden = Y;
Ajax.Post("index.php", n, pg.test(x));
}
What I am trying to do is to toggel the value of $pv->showHidden . So if it is 1 (already selected) then it will become 0 and vice versa. But logic isnt working.
Thanks in advance