Text field won't save with paypal button code
Adding paypal button code in a text field won't save. I recall that embedded style="" might cause issues, but what's wrong with adding paypal button code? Is there a fix for this?
http://hokudi.com/screenshot.png
Comments
$fields['paypal_button']['class'] = 'no_editor';
http://hokudi.com/screenshot_2.png
I'm thinking it has to do with validations happening on the data?
'sanitize_input' => array('template','php')
By default, the xss_clean function is applied to fields which can cause issues sometimes. Adding the above will remove that filter.
I actually tried something similar to that earlier. It didn't work. I tried: and
Changes to the field doesn't get saved. It doesn't save other fields as well if I try to save paypal button code. For example, I have two fields (1) price and (2) paypal_button. If I put in a valid price and paypal button code, the result is none of the fields are saved.
I know my form works fine because if I put in a valid price and leave the paypal button code out, it will save the price. So, I know the issue is with the paypal button code.
Have you found certain characters causing problems?
Yes, I've confirmed that the following html tag will cause the form to not save at all:
function on_before_validate($values){ $this->validate(); echo '<pre>'; print_r($this->get_errors()); echo '</pre>'; exit(); }
I have a bare bones setup. It's a simple module with no added tweaks.
INTERESTING FIND:
When I change the database field name from "paypal_button" to "comments2," it works! If I name it "test" or "test2," it doesn't work! I also tried renaming it to something completely random like "asdf," and it still doesn't work! It works for "comments" and "comments2" though!
What could possibly be causing this??
I figured if I change the database field name to "content" similar to the blog post module, it would work (don't know why I thought this). I did and it did work! I also tried naming it "paypal_content" and it worked also......