Reset default values

Support MB Settings Page Reset default valuesResolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #12545
    AleAle
    Participant

    I'm wondering whether is possible to reset any field that has been changed to its default value.

    So what I'm looking for is a way to reset the field "text-with-default" to it's default value: The default text.

    $meta_boxes[] = array(
    
        'id' => 'some_meta',
        'title' => 'Some meta',
        'settings_pages' => 'the-page',
            'fields' => array(
            array(
                'name'    => 'Something',
                'id'    => "something",
                'type'  => 'text',
                'std' => 'The default text.'
            )
        )
    )

    Thanks!

    #12548
    FarheenFarheen
    Participant

    Hello Ale,

    I am unable to understand your problem. Can you please clarify a bit more.

    Thanks.

    #12549
    AleAle
    Participant

    Hello Farheen,

    Sure no problem. A text field can be set with a default value using:

    'std' => 'The default text.'

    If I actually change the text field with anything other, I have no way to go back to the original default value, is there a way to add a button that resets the original default value?

    Thanks.

    #13345
    AleAle
    Participant

    Any new reply on this? Thanks.

    #13358
    Anh TranAnh Tran
    Keymaster

    Hi Ale, currently there's no way to reset to default value 🙁 I guess this can be done via custom attribute (to store the default value) and some JS.

    #13361
    AleAle
    Participant

    Thanks Anh for your reply, I will try what you suggest.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.