• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Hide fields depending menu id

Hide fields depending menu id 9 years 8 months ago #32012

  • andrea74
  • andrea74's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Thank you received: 1
Hello, is it possible to hide some form fields (textbox and submit button) depending Joomla menu id?
For example if the url is www.mywebsite.com/index.php?option=com_k...ory&id=68&Itemid=587 (menu ID=587) one textbox is not visible, but if the url is www.mywebsite.com/index.php?option=com_k...ory&id=68&Itemid=347 (menu ID=347) the same textbox is visible.
Thank you.
The administrator has disabled public write access.

Hide fields depending menu id 9 years 8 months ago #32024

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Try similar steps:

- firstly capture the Itemid parameter. This can be done by using the following snippet:
$app = JFactory::getApplication();
$capturedID = $app->input->getInt('Itemid');

- you can also add the above snippet within a hidden field, which will be captured and added as the hidden field value when your form loads. This following code is added within the Default Value area of the hidden field as such (including the //<code> tags):
//<code>
$app = JFactory::getApplication();
return $app->input->getInt('Itemid');
//</code>

- since you now have the item ID, you can try various approaches on this. For example:

a) If you're using the hidden field method, you could use JavaScript (while editing a form > Properties > CSS and JavaScript > JavaScript) to check the hidden field value and based on it, hide the desired form elements.

b) Otherwise, use PHP and directly adjust the Form Layout. More on RSForm!Pro PHP Scripts areas here.
This is not official customer support. To receive your support, submit a support ticket here.
Last Edit: 9 years 8 months ago by adrianp.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!