Hi,
I have a javascript code and I want to call a snippet that stores a value in a placeholder. The problem is that I want to pass the value stored in a var and I am passing the name. The code is as follows:
var rid = getselectedid();
[[save_id?&cod=rid]];
In save_id there’s just a call to setplaceholder()
$modx->setPlaceholder(reg_id,$cod);
does anybody know how to pass the rid value??
Thanks
-
MODX Staff
- 10,725 Posts
Javascript is not executed until the server processes the PHP on the server. You cannot set server-side processed variables with javascript variables that will not exist until the page is rendered.
Is there anyway I can save a var’s value generated in javascript code?
-
☆ A M B ☆
- 24,524 Posts