Using "Hidden" fields on forms, a possible gotcha due to encryption

#1
[eluser]TWP Marketing[/eluser]
I used "form_hidden()" to pass my record ID from an edit form and discovered that the field is actually encrypted and this resulted in my code failing to recognize it. The form_validation() test failed on the ID field when it was 'required'.

I can work around this, since the data is only visible to administration level and above, but thought it worthwhile to warn anyone else to watch out for this 'gotcha', The UserGuide does NOT mention the encryption of hidden form fields, so I will be editing my copy of UserGuide to reflect the missing information. FYI

#2
[eluser]cwt137[/eluser]
CI does not encrypt hidden form fields. I use hidden form fields all the time to pass a record id. There is something wrong with your program. Maybe you are manipulating the variable before you put it into your form? Check that the value you think is going into the form field is correct. You can look at the html source.

#3
[eluser]TWP Marketing[/eluser]
cwt,
You're correct, I was seeing the field content after the form had processed it and my code did specify encryption. Thanks for the reply.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.