Is there a way to implement a select all option for drop down selections within a new ticket in v1.10? I have been looking but can't really seem to even find where the question has been asked.This used to be an option in 1.9.14(our previous version) but doesn't seem to be in new version?

You'll have to modify these 2 partshttps://github.com/osTicket/osTicket/blob/develop/include/class.forms.php#L3418-L3434Add the html for your button/checkbox link etchttps://github.com/osTicket/osTicket/blob/develop/include/class.forms.php#L3438-L3443Listen for a trigger to your control and execute one of the following commandsSelect all$("#<?php echo $this->id; ?> > option").prop("selected","selected");$("#<?php echo $this->id; ?>").trigger("change");Unselect all$("#<?php echo $this->id; ?> > option").removeAttr("selected");$("#<?php echo $this->id; ?>").trigger("change");

I will give this a run on my dev server and get back to you, but my first impression is "Thank you sir you nailed it"

Could you be a bit more specific? my jQuery experience is not as up to speed as I think it should be

http://jsfiddle.net/fyhsz9ra/1664/Have a look at this fiddle

Perfect, I can work something up with this. Thank you very much

3 months later

I have got this to work, however for some reason it also attempts to save the ticket when the buttons are clicked, which I haven't really figured out why                $("#<?php echo $this->id; ?>-all").click(function(){                        $("#<?php echo $this->id; ?> > option").prop("selected","selected");                        $("#<?php echo $this-id; ?>").trigger("change");                });                $("#<?php echo $this->id; ?>-none").click(function(){                        $("#<?php echo $this->id; ?> > option").removeAttr("selected");                        $("#<?php echo $this-id; ?>").trigger("change");                });

You might have to debug the generated code.

I would suspect it's that you're not stopping click propagation. If you wanted to trigger change from click, you have to say you don't want click anymore otherwise it bubbles up the DOM looking for a handler, maybe it finds one in the form that submits it?

Genius. Adding event.preventDefault() to the end of the function worked. funny enough, event.stopPropagation does not but I'm not a javascript master so meh.Now to get the select all only apply to a single input line instead of all lines with multiple choices. Which I haven't figured out just yetThx for the assist Griz

I have completed all edits related to this topic. You may close at your convienceThanks for the help

Write a Reply...