Title: Query Parameter
Last modified: July 22, 2020

---

# Query Parameter

 *  Resolved [Imran Siddiq](https://wordpress.org/support/users/flickimp/)
 * (@flickimp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/)
 * If I have an URL:
    [https://Sitename/Page1](https://Sitename/Page1)
 * And there will be a copy called:
    [https://Sitename/Page2](https://Sitename/Page2)
 * How do I do a query parameter that picks up the Page 1 or Page 2 bit?
    I want
   to use them in a hidden field to decide which Select fields are shown/activated
   on a page.

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

 *  Thread Starter [Imran Siddiq](https://wordpress.org/support/users/flickimp/)
 * (@flickimp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13155480)
 * Changed my mind.
    Using the Hidden Field to show Page Id ….. ie: 170 for the 
   current page
 * But when using Visibility Logic – it doesn’t hide when the field is 170 (because
   the rule was to only show when page id is 182)
    -  This reply was modified 5 years, 10 months ago by [Imran Siddiq](https://wordpress.org/support/users/flickimp/).
 *  Thread Starter [Imran Siddiq](https://wordpress.org/support/users/flickimp/)
 * (@flickimp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13156952)
 * Would be really good if someone can workout how I make the Hidden Field pickup
   the Post ID of a page.
 * Because at the moment it’s not working.
 *  [Predrag – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support1/)
 * (@wpmudev-support1)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13160271)
 * Hi [@flickimp](https://wordpress.org/support/users/flickimp/),
 * You can find more information on how to use the pre-populated fields on our docs
   page here:
    [https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-values](https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-values)
 * However, I’m not sure that I understand completely what is supposed to happen
   so would you mind explaining a bit with step by step on how the forms should 
   work and what should happen?
 * Also, about the Page ID not working, are you saying that it doesn’t pick up the
   ID in the current form or that it doesn’t pass that on the second form?
 * Cheers,
    Predrag
 *  Thread Starter [Imran Siddiq](https://wordpress.org/support/users/flickimp/)
 * (@flickimp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13160296)
 * I hope this helps;
 * Say you got to a Webpage [https://www.fake.com/Location1](https://www.fake.com/Location1)
 * The Page ID for this is 155
 * I have a form that has 10 Datepickers, because each DataPicker is unique per 
   location (in terms of selectable days etc)
 * When the user goes to this page, the datepicker for this form has a rule = Only
   show when the Hidden Field = 155
 * And the Hidden Field was set up to be the Post/Page ID
 * But at the moment, when you go to the page, it shows all 10 datepickers and isn’t
   restricting itself to only show 1, because the other 9 pages have different Page
   IDs.
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13162206)
 * Hello [@flickimp](https://wordpress.org/support/users/flickimp/) ,
 * It looks like Hidden Field is setting the value to Page ID correctly, however,
   it’s not working with the Conditional settings of other fields.
    I’ve reached
   out to the Forminator team about this issue to see if there is way to make it
   work. We will keep you updated.
 * kind regards,
    Kasia
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13164754)
 * Hello [@flickimp](https://wordpress.org/support/users/flickimp/) ,
 * I’ve talked with developers and this is a bug with the hidden field. Right now
   it can’t be used for the visibility rules. I’ve reported that bug and developers
   will take care of it.
 * kind regards,
    Kasia
 *  Thread Starter [Imran Siddiq](https://wordpress.org/support/users/flickimp/)
 * (@flickimp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13164782)
 * Thanks
 * Is there a way to not use a hidden field?
    So could I use a Name/Text field that
   just pulls in the Page ID?
 * And then I can use that for the visibility rules.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13172047)
 * Hi [@flickimp](https://wordpress.org/support/users/flickimp/)
 * I hope you are doing well.
 * You can a query parameter for this, the same way that [@wpmudev-support1](https://wordpress.org/support/users/wpmudev-support1/)
   suggested:
    [https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-values](https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-values)
 * However, for this, you would need to add the parameter to the URL, for example
 * `/my-form/?id=10`
 * I pinged our developers to check if there any other way for that may be using
   some JavaScript.
 * We will update once hearing back from the developers.
 * Best Regards
    Patrick Freitas
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13172106)
 * Hi [@flickimp](https://wordpress.org/support/users/flickimp/)
 * I just received an update from our developers.
 * I found a workaround that you can try using some custom JavaScript.
 * On this thread, you can find a custom code that collects the page ID using JavaScipt:
   [https://stackoverflow.com/a/43809212](https://stackoverflow.com/a/43809212)
 * Once the ID stored on a variable, you can set the value on your regular text 
   field using:
 * `document.getElementById('forminator-field-text-1').value=id;`
 * And then trigger the conditionals using:
 * `jQuery("#forminator-field-text-1").trigger('change');`
 * [https://monosnap.com/file/J4t5egaFJkt0yLtqr9Xmpc6NNkRfVh](https://monosnap.com/file/J4t5egaFJkt0yLtqr9Xmpc6NNkRfVh)
 * Just replace the **forminator-field-text-1** to your field ID.
 * [https://monosnap.com/file/mxlSFjNmYgLWSK2LF30eTtkJPzCHcJ](https://monosnap.com/file/mxlSFjNmYgLWSK2LF30eTtkJPzCHcJ)
 * Most of the time the theme options has the field to add custom JavaScripts code,
   but in case it doesn’t have, you can use a plugin like [https://wordpress.org/plugins/custom-css-js/](https://wordpress.org/plugins/custom-css-js/)
   just make sure the JS loads on the footer.
 * Let us know the result you got.
    Best Regards Patrick Freitas

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

The topic ‘Query Parameter’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [query parameter](https://wordpress.org/support/topic-tag/query-parameter/)

 * 9 replies
 * 4 participants
 * Last reply from: [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/query-parameter/#post-13172106)
 * Status: resolved