I need to set hidden vars from within custom admin plugin page (cos postback with url query params is not allowed (permissions) in wordpress. e.g.
<script>
function change_event(invar1)
{
document.getElementById('my_tag').onclick = function(){new_func();}
//alert (invar1); //happiness
//Set hidden vars //oh crap, script breaks , next alert does not alert, and hdnCmd remains blank after this
document.getElementById('hdnCmd').value=invar1;
alert ("hdn = " + document.getElementById('hdnCmd').value);
//reload the window
//window.location.reload();
}
</script>
Thx
Resolved.
Pointy thx, tried the register scrit, but no go. So, found a plugin which allows WP admin pages to use params in the url.
Then in another page,...this is interesting...and did not have to register scripts either. I had to use a dropdown to select the "MenuItem" eg Sandwiches, vs Pita breads, vs Salads to assign Fillings for those menu items,..I now had to use javascrit and hiddeen inputs. which turned out to be 2 pronged approach.. also using Jquery
On php side, per row of my table constructed with db data in it (edit, del,ins,updt) I set the hidden var from the url param..
eg.
and the drop down (bit different as i used an associative array such that I could get the Datarow's PK and the description to display