Hi all im very new to javascript so please be gentle. im mixing php with my calls and I have a slight issue. I need to alter the function name that is called in an onclick event.
<div class=\"span4\" id=\"pass\">
<button class=\"btn btn-block btn-large btn-warning\" id=\"bypass\" disabled onclick=\"pass(); return false;\">
-
</button>
</div>
above is the div with the std call. before this point some variables are set from another function call and I need to change the above call to "pinpass2() or pinpass3 etc.
function pincheck(id,type,lastid,pin){
document.getElementById('fade').style.display=\"block\";
document.getElementById('calc').style.display=\"block\";
var staffid = id;
document.getElementById('bypass').onclick = function (){\"pinpass\"+staffid();
return false;
};
}
the above is the function that should do it but i can't seem to get it working. Any help appreciated. p.s if i include the following into the pincheck function the desired staffid is diaplayed
alert(\"staff id\"+staffid);
staffidas an argument?staffid = idis not doing anything in this function; you could just refer toid.