spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

How can i get Select box close event when click out of the select box any where in window?


There is no onClose event for select element. You can try the $.focusout event handler with something like this:

$('#mySelect').focusout(function(){
    console.log('Dropdown list 1 losing
focus...');
    $('#anotherElement').focus();
});

This way, when you click outside of the box, the focusout event will be fired, and it will trigger another element's focus event.

Fiddle available here.

$(document).ready(function
(e) {
    $('#mySelect1').focusout(function(){
        console.log('Dropdown list 1 losing
focus...');
        $('#mySelect2').focus();
    });
});
select{
    margin:5px;
}
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label for="myselect1">Dropdown list
1</label>
<select id="mySelect1">
    <option value="0">Initial Value
1</option>
    <option value="1">Initial Value
2</option>
    <option value="2">Initial Value
3</option>
    <option value="3">Initial Value
4</option>
</select>

<br />

<label for="myselect2">Dropdown list
2</label>
<select id="mySelect2">
    <option value="0">Initial Value
5</option>
    <option value="1">Initial Value
6</option>
    <option value="2">Initial Value
7</option>
    <option value="3">Initial Value
8</option>
</select>


Categories : Javascript

Related to : How can i get Select box close event when click out of the select box any where in window?
Clickable USA Map bound to Multi select ListBox -jQuery click event not firing
<script src="jquery.js"></script> <script type="text/javascript"> $(function() { //run when the DOM is ready $("#planetmap area").click(function (e) { // jQuery code, event handling callbacks here $('#mymapselect option[value="' + this.id + '"]').attr('selected', 'selected'); }); }); </script> I downloaded the jquery.js file from http://learn.jquery.com/about-jq

Categories : Javascript
How to select what button is being clicked on a multi-button click event, backed by sql
This is how I determine which button was clicked, and then use a Select Case to determine what to do with said button click. Dim bt As Button = o Dim btName As String = bt.Text In your case if the name of the button or the id is tied directly to a value you can just pass that into your parameters by accessing it from the bt variable.

Categories : SQL
Select Word like Double Click in AvalonEdit
No, this is not exposed in the API. You can get close by executing the EditingCommands MoveLeftByWord (Ctrl+Left) and SelectRightByWord (Ctrl+Shift+Right) after each other, but this doesn't have the desired effect if the caret is placed at the beginning of the word. EditingCommands.MoveLeftByWord.Execute(null, textEditor.TextArea); EditingCommands.SelectRightByWord.Execute(null, textEditor.TextAr

Categories : Misc
How to select filtered results on a button click from datatable using jquery
you can get the filtered rows by using: var rows = $(".datatable").dataTable().$('tr', {"filter":"applied"}); then you can iterate each row and apply what you need check https://datatables.net/forums/discussion/18375/get-all-filtered-rows-across-all-pages for more info

Categories : Javascript
Laravel blade multiple select. How to select records in the pivot table?
You are almost there. First make sure you have the correct relationship defined in your project model public function users(){ return $this->belongsToMany('User'); } Now to get the ids of all assigned users: $assignedUserIds = $project->users()->lists('id'); And just pass that to the view...

Categories : PHP
Recently Add
Busy Indicator while page is loading
parent.document.getElementById and images path
Can not get bootstrap datetime picker to display properly
reading select box jquery issues
DC.JS Pie Chart + Select Deslect from external JavaScript function
Why would I ever need to cancelAnimationFrame()
Angular.ui alert doesn't close
HTML/JS How to position a rectangle relative to 'any' side of the parent canvas element
parse variable to xml
C# Dictionary equivalent in JavaScript
ExtJS Dashboard Panel Fit Panel Vertically
jQuery cross domain ajax call - Interpreted as script but transferred with MIME type text/xml
Reactjs map returns unexpected token }
Working with multiple pages in apache cordova and vs2013
Resize iframe to loaded content
Why 13596*0.1 is different than 13596/10?
AngularJS Validate all forms on application load
javascript open popup without menu/url/titlebar/scrollbar/anything
Can I use Razor syntax inside Javascript included in a ScriptBundle?
How to show a box for comment reply with id
parse name from user input when using jquery serialize
How to parse and load javascript object?
Marionette not navigating to the same url
Adding Google+ Sign in button to website
GRUNT - Install Grunt Packages?
how should I create the path of templateUrl property in Angular ui-router?
Update mysql database with jquery array using ajax
Run the same function on each item in a list / array
Get all ticks values (NVD3)
Button Click Event not Passing input String to MVC Controller Method
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.