• 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: Reset checkboxes on form posting

Reset checkboxes on form posting 8 years 5 months ago #33129

Folks,
I know this has been asked before, and I have read the documentation on resetting custom fields, and looked through the forum, but still cant get it... I know it is something small, but as a newbie, I just cant see it.

I have a form called "My Form", with a Dropdown called "Field A"..... which has entries called "Ent 1", Ent 2", "Ent 3", "Ent 4" as the dropdown values.
I have 2 checkbox groups:
"Chk 1", (with 3 checkboxes), (conditional on "Field A" = "Ent 1"), and
"Chk 2", (with 4 checkboxes), (conditional on "Field A" = "Ent 2") (not worried now about "Ent 3" & "Ent 4"

If "Field A" = "Ent 1", I want to reset "Chk 2", and if "Field A" = "Ent 2", I want to reset "Chk 1"

I have the following code in the $Post_Form area, but I can't get it to work.... can anyone spot the obvious error which I cant see due to my ignorance?

if ($_POST == 'Ent 1')
{
unset($_POST);
}
if ($_POST == 'Ent 2')
{
unset($_POST);
}

Thanks folks,
Mike
The administrator has disabled public write access.

Reset checkboxes on form posting 8 years 5 months ago #33220

Any thoughts folks?

thanks,
Mike
The administrator has disabled public write access.

Reset checkboxes on form posting 8 years 4 months ago #33225

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
Hi Mike,

Accessing the values from $_POST can be done in the Scripts called during the form process like this:
$_POST['form']['fieldname']

Please note that if you are trying to access a dropdown's value you need to add the index like this
$_POST['form']['fieldname'][0]

More information on PHP Scripts can be found here:
https://www.rsjoomla.com/support/documentation/rsform-pro/getting-started/php-scripts.html
https://www.rsjoomla.com/support/documentation/rsform-pro/customizing-rsform-pro/custom-php-code.html
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

Reset checkboxes on form posting 8 years 4 months ago #33235

Thanks for that Cosmin... I will check it out and try to get this working... the "$_POST[0]" is a great help... I didnt realise that (must have missed it in the documentation).

thanks again,
Mike
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!