Welcome Guest, Not a member yet? Register   Sign In
Disabled input fields and radio buttons
#1

[eluser]swissbastian[/eluser]
Hi there

I'd like to have a form in which some fields, in my case radio buttons, aren't enabled if there's a specific reason. I thought I could check these reasons and then set a radio button disabled if necessary.

Now, if I check the values of the submitted form like that

Code:
if ($this->input->post('radiobutton')

I should be able to get the submitted data into my update array if the button's enabled. If it was disabled $this->input->post('radiobutton') should return FALSE, am I right?

I'm wondering because the data's not submitted if the buttons not disabled.

Does anyone know the behaviour of this function when dealing with disabled input fields?
#2

[eluser]bigtony[/eluser]
You are correct in thinking that disabled fields will return false if you use input->post (it's one of the advantages of using it over using $_POST).
#3

[eluser]swissbastian[/eluser]
Can it be that $this->input->post also returns FALSE when I submit the value 0 (zero) with the radio button?
#4

[eluser]AlexPOWER[/eluser]
yeap that's right it's a same FALSE




Theme © iAndrew 2016 - Forum software by © MyBB