I’m trying to get an input field value and save it into a placeholder using a hook.
The normal process is something like this:
<input type="text" name="score" id="score" value="000">
[hook]:
<?php
$score = $hook->getValue('score');
$modx->setPlaceholder('score',$score);
Then I can call the value using the [[+score]] placeholder.
But I’m using formalicious, in order to save a field into formIt it’s necessary to use [[!+id]] in the name field:
<input type="text" name="field_[[!+id]]" id="score" value="000">
that makes the name dynamic and can’t use the:
$score = $hook->getValue('score');
How can I get the value of that input field?
Thanks for your help!