Astalyos Posted November 1, 2021 Share Posted November 1, 2021 Hi ! I would like to find a way to set the default value of my select input, from the one saved in database. Because when I edit something, if i don't re-set the value of my select input it just come back to default (first value of my select input) Editing it everytime I want to edit something else take me time that could be save I guess. Thx for your Help ! Have a nice day Link to comment Share on other sites More sharing options...
ps8modules Posted November 2, 2021 Share Posted November 2, 2021 (edited) if (Tools::getValue('your_id1')) { $select1 = dB::getInstance()->getValue('SELECT select_bg_color FROM '._DB_PREFIX_.'custom_slider_lang WHERE id_customslider_slides = '.Tools::getValue('your_id1').' AND id_lang = '.$id_lang); $this->fields_value['select_bg_color'] = $select1; } else { $this->fields_value['select_bg_color'] = 'bg-new-colection-3'; } Tools::getValue('your_id1') is your selected id_customslider_slides for edit. $id_lang = context language id Edited November 2, 2021 by WebSoft (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now