Radio buttons won't return any value
Radio buttons won't return any value
Hi,
I'm using CMSMS 1.12.
I'm busy developing a module for a customer.
I have created a form with PHP and Smarty.
The text input types submit values fine.
I can't get the radio buttons to return any value.
I've used {html_radios} from Smarty. I also tried CreateInputRadioGroup. Now I'm using simple HTML in my template.
Unfortunately, without any success so far.
Can anybody help me out?
Thanks in advance.
I'm using CMSMS 1.12.
I'm busy developing a module for a customer.
I have created a form with PHP and Smarty.
The text input types submit values fine.
I can't get the radio buttons to return any value.
I've used {html_radios} from Smarty. I also tried CreateInputRadioGroup. Now I'm using simple HTML in my template.
Unfortunately, without any success so far.
Can anybody help me out?
Thanks in advance.
Re: Radio buttons won't return any value
Actually, I seem to have this issue not only with radio buttons, but also with checkboxes and dropdowns.
How can I get the value to be passed through and remembered?
Anybody?
How can I get the value to be passed through and remembered?
Anybody?
Re: Radio buttons won't return any value
We need far more info about what you are trying to do than what you are providing...
Specifically, but not limited to:
http://forum.cmsmadesimple.org/viewtopi ... =40&t=2661
If you don't provide more detailed information, chances are that your questions will keep being ignored...
Specifically, but not limited to:
- - is it a module action?
- - which methods from the CMSMS API are you using, if any?
- - are you sure the variables are being passed to Smarty?
- - a sample of the template containing the form (doesn't have to be an exact copy but needs to have the same code logic you are trying to use);
- - is the form being submitted to the same action (assuming you are using the CMSMS API);
- - is it a frontend or backend form?
- - etc...
This is as vague as it can be... too many things can be wrong...chunteler wrote:I have created a form with PHP and Smarty.
The text input types submit values fine.
I can't get the radio buttons to return any value.
http://forum.cmsmadesimple.org/viewtopi ... =40&t=2661
If you don't provide more detailed information, chances are that your questions will keep being ignored...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Radio buttons won't return any value
Thanks for your reply Jo Morg!
It is indeed a module action.
It is a front end form.
The form is submitted to the same action.
I'm pretty sure the variables are being sent to Smarty.
I'm including both .php en .tpl files with this reply.
Hope this makes it more clear.
Thanks.
It is indeed a module action.
It is a front end form.
The form is submitted to the same action.
I'm pretty sure the variables are being sent to Smarty.
I'm including both .php en .tpl files with this reply.
Hope this makes it more clear.
Thanks.
- Attachments
-
[The extension txt has been deactivated and can no longer be displayed.]
-
[The extension txt has been deactivated and can no longer be displayed.]
Re: Radio buttons won't return any value
Given the way CMSMS API works with form submissions you always need to insert the action id value before the wanted field name otherwise the field will be ignored. While methods like $this->CreateInput... do this for you from the $id var that is set in scope on the action file/method, you'll have to add it yourself when using Smarty tags such as {html_options}.
So you'll need to replace:whith:
Additionally you'll have to adjust all the names associated with those smarty tags in the same way.
HTH
Note: As you can see it was easy to try to help given enough information...
So you'll need to replace:
Code: Select all
{html_options name=prijzen options=$PrijsOptions selected=$prijs_select}
Code: Select all
{html_options name="{$actionid}prijzen" options=$PrijsOptions selected=$prijs_select}
HTH
Note: As you can see it was easy to try to help given enough information...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Radio buttons won't return any value
Great! Thanks Jo Morg!
How do I then call the value?
$prijzen = $params['?????']
How do I then call the value?
$prijzen = $params['?????']
Re: Radio buttons won't return any value
The parameters are sent to the action already stripped of the action id, so you are doing it correctly, in this case: $prijzen = $params['prijzen']; is correct, although you may have to check if the parameter is set before using it.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Radio buttons won't return any value
I'm sorry, but I can't get it to work.
I'm new to CMSMS and Smarty.
I'm posting my new code. What am I missing?
I'm new to CMSMS and Smarty.
I'm posting my new code. What am I missing?
- Attachments
-
[The extension txt has been deactivated and can no longer be displayed.]
-
[The extension txt has been deactivated and can no longer be displayed.]
Re: Radio buttons won't return any value
Try putting: at the very top of the action file to see which parameters are available on that action and if they hold the values you are expecting.
Also keep in mind that the CMSMS module API may drop unknown parameters (if you have $this->RestrictUnknownParams(); called on the constructor, on the deprecated SetParameters method, or on InitializeFrontend method).
If these are not registered for frontend actions with SetParameterType method call it may not work. Check the admin log for errors regarding parameters.
Also consult the API docs.
Code: Select all
debug_display($params);
Also keep in mind that the CMSMS module API may drop unknown parameters (if you have $this->RestrictUnknownParams(); called on the constructor, on the deprecated SetParameters method, or on InitializeFrontend method).
If these are not registered for frontend actions with SetParameterType method call it may not work. Check the admin log for errors regarding parameters.
Also consult the API docs.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Radio buttons won't return any value
Also, be sure you read the module writing tutorial at: http://docs.cmsmadesimple.org/uploads/M ... torial.pdf
BTW: All of those 'CreateInputHidden' and 'CreateInputText', etc, methods are deprecated and we discourage their use.
BTW: All of those 'CreateInputHidden' and 'CreateInputText', etc, methods are deprecated and we discourage their use.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Radio buttons won't return any value
Thanks both for your help.
One last question... My customer uses CMSMS 1.12.
The document you do reference to Calguy 1000 is for CMSMS 2.0.1+.
Will that work?
One last question... My customer uses CMSMS 1.12.
The document you do reference to Calguy 1000 is for CMSMS 2.0.1+.
Will that work?