Hi,

Anyone know how to save a selected option to the form/$_POST

I got the config page all done other than it wont save the option selected in the html select. So since i
made the field required it says its required.

I have looked at other pages with selects, as well as a plugin with a select. And i still cant seem to find the
function that saves the value selected. I know there is a save function but that saves the input for the OTP code im sure, maybe not.

Also i still need to match the sending address to the option chosen, i figure ill just get the value of what is selected and pick it out of an array during the send function. It would probably be better to save the array key rather than the text name as the option selected that way it would be easier to select the appropriate carrier sms address

Again i need some pointers on how to save the selected input value, thanks 🙂

  • class.config.php has this and its what i need to create the new key..

    function create($key, $value) {
            $item = new ConfigItem([
                $this->section_column => $this->section,
                'key' => $key,
                'value' => $value,
            ]);
            if (!$item->save())
                return false;
    
            return true;
        }	

I thought i had it with the ajax.staff.php but still says its required, its not recording somewhere.

Its not saving my selection, and i dont know why... still says its a required field.... hmmmmm

I meant to update this earlier today. I found it, the reason it was not saving is because there is no native config key for
2fa-sms to update, so ill have to add that key to the sql array which builds a new user. Again when im done if someone wants to make this a plugin go for it..

class.config.php has this and its what i need to create the new key..

function create($key, $value) {
        $item = new ConfigItem([
            $this->section_column => $this->section,
            'key' => $key,
            'value' => $value,
        ]);
        if (!$item->save())
            return false;

        return true;
    }	
Write a Reply...