Jump to content

Trying to create an input field that process data as text but gets processed as int


Recommended Posts

I'm building a fieldtype/inputfield to visually select a grid like Bootstrap since it's the first time coding such thing, I'm basing my code in FieldtypeColorPicker since the base structure is the same, a graphical UI helper to finally output a string as value.

The problem is I try to save the value as something like "1,2,3" referencing the index of each column selected but it gets converted as an int value so "1,2,3" becomes "1" if input random text it gets converted as "0".

Here is the code:

https://github.com/carlitoselmago/FieldtypeGridSpace

Here's an screenshot of how it looks

image.png.93e5a080264f8b2c97bb96bcc4bb671d.png

Link to comment
Share on other sites

Yes maybe the cache. 

Try to clear the compiled files and your browser cache then refresh the module.

 

Quote

Actually I don't understand how this part works very well

What I did is, downloading your module from Github, installed it, dumped the var with TracyDebugger - which you should install in a hurry - and tada, it seem it worked ??

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...