Title: Set filter with Javascript (need help on submit)
Last modified: February 22, 2022

---

# Set filter with Javascript (need help on submit)

 *  Resolved [igorneumann](https://wordpress.org/support/users/igorneumann/)
 * (@igorneumann)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fset-filter-with-javascript-need-help-on-submit%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/set-filter-with-javascript-need-help-on-submit/#post-15394343)
 * Hello there.
 * Thank you for reaching out to us.
 * Please note that filters are not included in the Lite version of the plugin, 
   and since commercial products are [not supported in these forums](https://wordpress.org/support/guidelines/#do-not-post-about-commercial-products),
   as per [this comment](https://wordpress.org/support/topic/error-when-not-logged-into-wordpress-backend/#post-15050671)
   by WordPress.org moderators, can you please open a ticket on our [official support platform](https://tmsplugins.ticksy.com/),
   and we’ll gladly help you there?
 * Thank you for your understanding.
 *  Thread Starter [igorneumann](https://wordpress.org/support/users/igorneumann/)
 * (@igorneumann)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/set-filter-with-javascript-need-help-on-submit/#post-15413848)
 * Thanks, will ask there.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Set filter with Javascript (need help on submit)’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [igorneumann](https://wordpress.org/support/users/igorneumann/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/set-filter-with-javascript-need-help-on-submit/#post-15413848)
 * Status: resolved