Set filter with Javascript (need help on submit)
-
We need to code a way to set a hidden filter field with the username (stored in a variable)
I know isnt something really supported by the plugin by default but we did manage to hide (css) and fill (javascript) the field with the variable content already (it has a invalid default value so it shows nothing when loaded)
The code we have almost working for now is:
<script type=”text/javascript”>
var userid = “<?php echo do_shortcode(‘[prflxtrflds_field field_id=1]’);?>”;
function filluser() {
document.querySelector(“#table_2_4_filter > span > input”).value = userid;
}
</script>
<button onclick=”filluser()”>Rellenar usuario</button>We plan to replace the button trrigger by “onload” but despite replacing the field content it doesnt “submit” it.
Any help on how can we submit a filter fiield using javascript?
The page I need help with: [log in to see the link]
- The topic ‘Set filter with Javascript (need help on submit)’ is closed to new replies.