Buy Now
Sign in

Dropdown all select

rafaelscouto , September 06 2019, 19:15
R
rafaelscouto 167
September 06 2019, 19:15 #389137
Hi
I have a dropdow and it has:

= All
1 = Sao Paulo
2 = Salvador
3 = Rio de Janeiro

Is there any way to choose ALL items without multi select?

I would like to select all but not one by one, understand?
GreyHead 64
September 07 2019, 07:24 #389140
Hi rafaelscouto,
You could use Custom JavaScript to check if the 'All' option is selected and check all the itemd. Or you could do that with PHP after the form submits.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
R
rafaelscouto 167
September 09 2019, 12:04 #389148
I'm using the following JS

function changeSelection(value){

var length = document.getElementById("id_secretaria").options.length;

if(value == 0){
for(var i = 1;i<length;i++)
document.getElementById("id_secretaria").options[i
  • .selected = "selected";

    document.getElementById("id_secretaria").options[0].selected = "";
    }

    }
  • And in my options dropdown field I have
    id = secret_id and onchange: changeSelection (this.value)


    0 = ALL
    1 = item1
    2 = item2
    ...
    is return this below
    Array
    (
    [read_relatorios] => Array
    (
    [log] => Array
    (
    [0] => SELECT `Rel`.`aid` AS `Rel.aid`, `Rel`.`user_id` AS `Rel.user_id`, `Rel`.`created` AS `Rel.created`, `Rel`.`modified` AS `Rel.modified`, `Rel`.`data` AS `Rel.data`, `Rel`.`horario` AS `Rel.horario`, `Rel`.`evento` AS `Rel.evento`, `Rel`.`local` AS `Rel.local`, `Rel`.`responsavel` AS `Rel.responsavel`, `Rel`.`observacao` AS `Rel.observacao`, `Rel`.`arquivo_anexo` AS `Rel.arquivo_anexo`, `Rel`.`objetivo` AS `Rel.objetivo`, `Rel`.`id_secretaria` AS `Rel.id_secretaria`, `Rel`.`status` AS `Rel.status`, `Rel`.`setor` AS `Rel.setor` FROM `syscf_z_agenda_geral` AS `Rel` WHERE `Rel`.`data` >= '2019-09-02' AND `Rel`.`data` <= '2019-09-04' AND `Rel`.`id_secretaria` = '[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"12\"]' ORDER BY `Rel.data` ASC, `Rel.horario` ASC;
    )

    [var] => Array
    (
    )

    )

    )
    R
    rafaelscouto 167
    September 11 2019, 12:29 #389170
    I received an email notification of a new reply, but the system here shows nothing
    healyhatman 8
    September 11 2019, 14:08 #389171
    You'll get notified of replies even if it's from a user who just joined and posted something that hasn't been approved yet. I don't see it either, which means it was most likely spam.
    Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
    Donations: paypal.me/healyhatman
    Professional Work: kamron@skyspider.com.au
    Custom CF / CC Plugins and Extensions: skyspider.com.au/store
    R
    rafaelscouto 167
    September 16 2019, 19:24 #389213
    the return I have is this, in case only option 2 is being listed

        [0] => SELECT `Rel`.`aid` AS `Rel.aid`, `Rel`.`user_id` AS `Rel.user_id`, `Rel`.`created` AS `Rel.created`, `Rel`.`modified` AS `Rel.modified`, `Rel`.`data` AS `Rel.data`, `Rel`.`horario` AS `Rel.horario`, `Rel`.`evento` AS `Rel.evento`, `Rel`.`local` AS `Rel.local`, `Rel`.`responsavel` AS `Rel.responsavel`, `Rel`.`observacao` AS `Rel.observacao`, `Rel`.`arquivo_anexo` AS `Rel.arquivo_anexo`, `Rel`.`objetivo` AS `Rel.objetivo`, `Rel`.`id_secretaria` AS `Rel.id_secretaria`, `Rel`.`status` AS `Rel.status`, `Rel`.`setor` AS `Rel.setor` FROM `syscf_z_agenda_geral` AS `Rel` WHERE `Rel`.`data` >= '2019-09-11' AND `Rel`.`data` <= '2019-09-14' AND `Rel`.`id_secretaria` = '2,4' ORDER BY `Rel.data` ASC, `Rel.horario` ASC;
    healyhatman 8
    September 16 2019, 22:08 #389214
    `id_secretaria` = '2,4' 
    That should be IN not =
    Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
    Donations: paypal.me/healyhatman
    Professional Work: kamron@skyspider.com.au
    Custom CF / CC Plugins and Extensions: skyspider.com.au/store
    R
    rafaelscouto 167
    September 16 2019, 23:13 #389216
    thanks that helped a lot