Jquery Select Change Event - Lose Focus
up vote
0
down vote
favorite
I am creating floating labels for my select
elements when a user selects an option.
<div class="jvFloat"><label class="placeHolder active" for="input_18_61">Salutation</label><select name="input_61" class="gfield_select newsel" tabindex="49" aria-required="true" aria-invalid="false"><option value="" selected="selected" class="gf_placeholder">Salutation</option><option value="Miss">Miss</option><option value="Ms.">Ms.</option><option value="Mrs.">Mrs.</option></select>
However the floating label, only appears when the user selects another input or loses focus of the select
element.
How could I use the Jquery select change
event, to de-focus the select
element, after the user makes a choice?
$('select').change(function(){
})
.change();
jquery select
add a comment |
up vote
0
down vote
favorite
I am creating floating labels for my select
elements when a user selects an option.
<div class="jvFloat"><label class="placeHolder active" for="input_18_61">Salutation</label><select name="input_61" class="gfield_select newsel" tabindex="49" aria-required="true" aria-invalid="false"><option value="" selected="selected" class="gf_placeholder">Salutation</option><option value="Miss">Miss</option><option value="Ms.">Ms.</option><option value="Mrs.">Mrs.</option></select>
However the floating label, only appears when the user selects another input or loses focus of the select
element.
How could I use the Jquery select change
event, to de-focus the select
element, after the user makes a choice?
$('select').change(function(){
})
.change();
jquery select
Not sure about that.. I have some other code inside the code I specified, and the 'change' event fires when the option is changed..
– Joanna Mikalai
Nov 11 at 21:59
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am creating floating labels for my select
elements when a user selects an option.
<div class="jvFloat"><label class="placeHolder active" for="input_18_61">Salutation</label><select name="input_61" class="gfield_select newsel" tabindex="49" aria-required="true" aria-invalid="false"><option value="" selected="selected" class="gf_placeholder">Salutation</option><option value="Miss">Miss</option><option value="Ms.">Ms.</option><option value="Mrs.">Mrs.</option></select>
However the floating label, only appears when the user selects another input or loses focus of the select
element.
How could I use the Jquery select change
event, to de-focus the select
element, after the user makes a choice?
$('select').change(function(){
})
.change();
jquery select
I am creating floating labels for my select
elements when a user selects an option.
<div class="jvFloat"><label class="placeHolder active" for="input_18_61">Salutation</label><select name="input_61" class="gfield_select newsel" tabindex="49" aria-required="true" aria-invalid="false"><option value="" selected="selected" class="gf_placeholder">Salutation</option><option value="Miss">Miss</option><option value="Ms.">Ms.</option><option value="Mrs.">Mrs.</option></select>
However the floating label, only appears when the user selects another input or loses focus of the select
element.
How could I use the Jquery select change
event, to de-focus the select
element, after the user makes a choice?
$('select').change(function(){
})
.change();
jquery select
jquery select
asked Nov 11 at 21:44
Joanna Mikalai
65911034
65911034
Not sure about that.. I have some other code inside the code I specified, and the 'change' event fires when the option is changed..
– Joanna Mikalai
Nov 11 at 21:59
add a comment |
Not sure about that.. I have some other code inside the code I specified, and the 'change' event fires when the option is changed..
– Joanna Mikalai
Nov 11 at 21:59
Not sure about that.. I have some other code inside the code I specified, and the 'change' event fires when the option is changed..
– Joanna Mikalai
Nov 11 at 21:59
Not sure about that.. I have some other code inside the code I specified, and the 'change' event fires when the option is changed..
– Joanna Mikalai
Nov 11 at 21:59
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
This should work..
$('select').change(function(){
$(this).trigger('blur');
})
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
This should work..
$('select').change(function(){
$(this).trigger('blur');
})
add a comment |
up vote
1
down vote
accepted
This should work..
$('select').change(function(){
$(this).trigger('blur');
})
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
This should work..
$('select').change(function(){
$(this).trigger('blur');
})
This should work..
$('select').change(function(){
$(this).trigger('blur');
})
answered Nov 11 at 21:54
Stefan Pakic
618
618
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53253554%2fjquery-select-change-event-lose-focus%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not sure about that.. I have some other code inside the code I specified, and the 'change' event fires when the option is changed..
– Joanna Mikalai
Nov 11 at 21:59