Forums

[More Fields 2.0.5.2] multivalued fields (2 posts)

  1. masterpingouin
    Member
    Posted 1 year ago #

    Hi guys,

    I've been using More Fields for a while now, and as a junior PHP developper, the code seems to be well crafted.

    However, as if, More Fields can't handle multivalued fields, like multiselect and cloned textfields (with a bit of javascript).

    I tried to create my own (custom fields), but arrays of values won't save.

    There's a workaround that might work : Storing comma-separated values or serialized arrays in a string, but, it's a pain to use for non-programmers.

    Even if the source code is well done (OOP style), there's not enough comments in the code to make safe modifications.

    If you guys have an idea where to look at, i'll be glad to contribute.

    Cheers!

  2. masterpingouin
    Member
    Posted 1 year ago #

    Okay I just figured out how to manage multivalued fields :

    1. Create a page to deal with ajax calls fired by jquery in order to serialize values
    2. Each time jquery detect an update thanks to the .change() function, we call that page
    3. Create a PHP function to unserialize stored values in order to make things simple for web designer

Topic Closed

This topic has been closed to new replies.

About this Topic