jquery returns true to event handler but the event (get input) will not be ended
up vote
0
down vote
favorite
I have a form which contains input radio elements (2nd level under the header) into headers (to generate a selection) - this have been tested and functions normally.
To manage headers I have a query event click which performs (verified) actions when the header is not in the described case. So if we are not into the cases the .click event simple returns true to go on just after the test (a simple if).
The problem is that the input is not performed (the radio button which is into the header is never checked).
Note : If the actions are performed (no test done) the actions are performed and a second click is needed from user to get the radio button to be checked. This is the lonely case that I could check the radio button.
The js code is (summarized) :
$(".H_title")
.focusin(function(event) {
if ( ... ) { do stuff }
return true; // go on action
} )
.focusout(function() {...do_stuff);} );
//END
What can be the reason ?
Note : I cannot change quite anything into the html structure on which I operate because it is generated by several codes (php and other js). I must be able to check the radio buttons into the page without changing the structure and contents.
Best regards
Trebly
jquery html input event-handling
|
show 4 more comments
up vote
0
down vote
favorite
I have a form which contains input radio elements (2nd level under the header) into headers (to generate a selection) - this have been tested and functions normally.
To manage headers I have a query event click which performs (verified) actions when the header is not in the described case. So if we are not into the cases the .click event simple returns true to go on just after the test (a simple if).
The problem is that the input is not performed (the radio button which is into the header is never checked).
Note : If the actions are performed (no test done) the actions are performed and a second click is needed from user to get the radio button to be checked. This is the lonely case that I could check the radio button.
The js code is (summarized) :
$(".H_title")
.focusin(function(event) {
if ( ... ) { do stuff }
return true; // go on action
} )
.focusout(function() {...do_stuff);} );
//END
What can be the reason ?
Note : I cannot change quite anything into the html structure on which I operate because it is generated by several codes (php and other js). I must be able to check the radio buttons into the page without changing the structure and contents.
Best regards
Trebly
jquery html input event-handling
Hard to understand what the issue is here. You mention click event but show code for focusing a class we have no idea what it is. Please provide a Minimal, Complete, and Verifiable example that reproduces your issue and a better explanation of the actual problem
– charlietfl
Nov 11 at 18:27
JQuery running is 1.12.4
– Trebly
Nov 11 at 18:33
Checked at the end when jquery-migrate (1.4.1) is reached in "jQuery.event.trigger" that "event" has "bubbles = false".. Others data of the event and linked elements found into object in debugger are OK.
– Trebly
Nov 11 at 18:41
The issue is that nothing happens.
– Trebly
Nov 11 at 18:45
Nothing happens to what? Without an actual example your question is very hard to comprehend and is confusing
– charlietfl
Nov 11 at 18:48
|
show 4 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a form which contains input radio elements (2nd level under the header) into headers (to generate a selection) - this have been tested and functions normally.
To manage headers I have a query event click which performs (verified) actions when the header is not in the described case. So if we are not into the cases the .click event simple returns true to go on just after the test (a simple if).
The problem is that the input is not performed (the radio button which is into the header is never checked).
Note : If the actions are performed (no test done) the actions are performed and a second click is needed from user to get the radio button to be checked. This is the lonely case that I could check the radio button.
The js code is (summarized) :
$(".H_title")
.focusin(function(event) {
if ( ... ) { do stuff }
return true; // go on action
} )
.focusout(function() {...do_stuff);} );
//END
What can be the reason ?
Note : I cannot change quite anything into the html structure on which I operate because it is generated by several codes (php and other js). I must be able to check the radio buttons into the page without changing the structure and contents.
Best regards
Trebly
jquery html input event-handling
I have a form which contains input radio elements (2nd level under the header) into headers (to generate a selection) - this have been tested and functions normally.
To manage headers I have a query event click which performs (verified) actions when the header is not in the described case. So if we are not into the cases the .click event simple returns true to go on just after the test (a simple if).
The problem is that the input is not performed (the radio button which is into the header is never checked).
Note : If the actions are performed (no test done) the actions are performed and a second click is needed from user to get the radio button to be checked. This is the lonely case that I could check the radio button.
The js code is (summarized) :
$(".H_title")
.focusin(function(event) {
if ( ... ) { do stuff }
return true; // go on action
} )
.focusout(function() {...do_stuff);} );
//END
What can be the reason ?
Note : I cannot change quite anything into the html structure on which I operate because it is generated by several codes (php and other js). I must be able to check the radio buttons into the page without changing the structure and contents.
Best regards
Trebly
jquery html input event-handling
jquery html input event-handling
asked Nov 11 at 18:21
Trebly
65
65
Hard to understand what the issue is here. You mention click event but show code for focusing a class we have no idea what it is. Please provide a Minimal, Complete, and Verifiable example that reproduces your issue and a better explanation of the actual problem
– charlietfl
Nov 11 at 18:27
JQuery running is 1.12.4
– Trebly
Nov 11 at 18:33
Checked at the end when jquery-migrate (1.4.1) is reached in "jQuery.event.trigger" that "event" has "bubbles = false".. Others data of the event and linked elements found into object in debugger are OK.
– Trebly
Nov 11 at 18:41
The issue is that nothing happens.
– Trebly
Nov 11 at 18:45
Nothing happens to what? Without an actual example your question is very hard to comprehend and is confusing
– charlietfl
Nov 11 at 18:48
|
show 4 more comments
Hard to understand what the issue is here. You mention click event but show code for focusing a class we have no idea what it is. Please provide a Minimal, Complete, and Verifiable example that reproduces your issue and a better explanation of the actual problem
– charlietfl
Nov 11 at 18:27
JQuery running is 1.12.4
– Trebly
Nov 11 at 18:33
Checked at the end when jquery-migrate (1.4.1) is reached in "jQuery.event.trigger" that "event" has "bubbles = false".. Others data of the event and linked elements found into object in debugger are OK.
– Trebly
Nov 11 at 18:41
The issue is that nothing happens.
– Trebly
Nov 11 at 18:45
Nothing happens to what? Without an actual example your question is very hard to comprehend and is confusing
– charlietfl
Nov 11 at 18:48
Hard to understand what the issue is here. You mention click event but show code for focusing a class we have no idea what it is. Please provide a Minimal, Complete, and Verifiable example that reproduces your issue and a better explanation of the actual problem
– charlietfl
Nov 11 at 18:27
Hard to understand what the issue is here. You mention click event but show code for focusing a class we have no idea what it is. Please provide a Minimal, Complete, and Verifiable example that reproduces your issue and a better explanation of the actual problem
– charlietfl
Nov 11 at 18:27
JQuery running is 1.12.4
– Trebly
Nov 11 at 18:33
JQuery running is 1.12.4
– Trebly
Nov 11 at 18:33
Checked at the end when jquery-migrate (1.4.1) is reached in "jQuery.event.trigger" that "event" has "bubbles = false".. Others data of the event and linked elements found into object in debugger are OK.
– Trebly
Nov 11 at 18:41
Checked at the end when jquery-migrate (1.4.1) is reached in "jQuery.event.trigger" that "event" has "bubbles = false".. Others data of the event and linked elements found into object in debugger are OK.
– Trebly
Nov 11 at 18:41
The issue is that nothing happens.
– Trebly
Nov 11 at 18:45
The issue is that nothing happens.
– Trebly
Nov 11 at 18:45
Nothing happens to what? Without an actual example your question is very hard to comprehend and is confusing
– charlietfl
Nov 11 at 18:48
Nothing happens to what? Without an actual example your question is very hard to comprehend and is confusing
– charlietfl
Nov 11 at 18:48
|
show 4 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
Thanks to charlietfi for help in this question.
I understand that my explanations were not sufficiently precise to understand the case. More I had introduced an error when copying code.
There is a true problem of which I have found a solution which reaches the target but I am not sure of both the explanation of why it was not functioning and why it functions now.
There where two steps of development :
1- Just execute stuff when a span into a header is clicked (and but not involved another stuff on focusin the element while shiftkey is pressed).
The HTML structure contains :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
The reason of the first two levels of SPAN is that it is done by two different pieces of soft and need two different classes.
The associated code which was functioning (since three years) was :
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
2- I need to had in some cases a radio button and do no perform stuff1 in such case (just add an input into the header) then the HTML code became :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
<input name="user_type" type="radio" value="adh">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
and I wrote the js code which do not functions:
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action of the click on the button
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
In my opinion the error seems that the radio button become not reachable into the H_title span while it is without code to manage the event. Note : this is the same for focusin actions and events.
If there is no Jquery code written for the click event everything is running normally.
//BEGIN
$(".toc-target > input")
.click( function(){ return true; });
.focusin(function() {return true; } );
.focusout(function() {return true; } );
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1: move-top }
return true; // go on actions
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
With this code the click on the input functions, what is the behavior :
1- the $(".toc-target > input")
events are raised and return true which seems to do nothing lead to the normal selection of the radio button and event bubbles.
2- the H_titles gets his click event and it is executed it normally.
For now the focusin-focusout doesn't still function combined with the buttons I think that the problem comes from a conflict with the click (the fact that the header gets focus when clicked).
I have to clarify some ones about full ergonomics points and about compatibility (available on PC and Mobiles).
Another solution could be it seems "propagation" from H_title to the "input" but I have not found a good way to do everything needed into stuffxx and separate clearly the actions.
May be I am wrong or may be you have some suggestions to do it in a best way.
Best regards
Trebly
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Thanks to charlietfi for help in this question.
I understand that my explanations were not sufficiently precise to understand the case. More I had introduced an error when copying code.
There is a true problem of which I have found a solution which reaches the target but I am not sure of both the explanation of why it was not functioning and why it functions now.
There where two steps of development :
1- Just execute stuff when a span into a header is clicked (and but not involved another stuff on focusin the element while shiftkey is pressed).
The HTML structure contains :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
The reason of the first two levels of SPAN is that it is done by two different pieces of soft and need two different classes.
The associated code which was functioning (since three years) was :
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
2- I need to had in some cases a radio button and do no perform stuff1 in such case (just add an input into the header) then the HTML code became :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
<input name="user_type" type="radio" value="adh">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
and I wrote the js code which do not functions:
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action of the click on the button
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
In my opinion the error seems that the radio button become not reachable into the H_title span while it is without code to manage the event. Note : this is the same for focusin actions and events.
If there is no Jquery code written for the click event everything is running normally.
//BEGIN
$(".toc-target > input")
.click( function(){ return true; });
.focusin(function() {return true; } );
.focusout(function() {return true; } );
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1: move-top }
return true; // go on actions
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
With this code the click on the input functions, what is the behavior :
1- the $(".toc-target > input")
events are raised and return true which seems to do nothing lead to the normal selection of the radio button and event bubbles.
2- the H_titles gets his click event and it is executed it normally.
For now the focusin-focusout doesn't still function combined with the buttons I think that the problem comes from a conflict with the click (the fact that the header gets focus when clicked).
I have to clarify some ones about full ergonomics points and about compatibility (available on PC and Mobiles).
Another solution could be it seems "propagation" from H_title to the "input" but I have not found a good way to do everything needed into stuffxx and separate clearly the actions.
May be I am wrong or may be you have some suggestions to do it in a best way.
Best regards
Trebly
add a comment |
up vote
0
down vote
Thanks to charlietfi for help in this question.
I understand that my explanations were not sufficiently precise to understand the case. More I had introduced an error when copying code.
There is a true problem of which I have found a solution which reaches the target but I am not sure of both the explanation of why it was not functioning and why it functions now.
There where two steps of development :
1- Just execute stuff when a span into a header is clicked (and but not involved another stuff on focusin the element while shiftkey is pressed).
The HTML structure contains :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
The reason of the first two levels of SPAN is that it is done by two different pieces of soft and need two different classes.
The associated code which was functioning (since three years) was :
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
2- I need to had in some cases a radio button and do no perform stuff1 in such case (just add an input into the header) then the HTML code became :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
<input name="user_type" type="radio" value="adh">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
and I wrote the js code which do not functions:
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action of the click on the button
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
In my opinion the error seems that the radio button become not reachable into the H_title span while it is without code to manage the event. Note : this is the same for focusin actions and events.
If there is no Jquery code written for the click event everything is running normally.
//BEGIN
$(".toc-target > input")
.click( function(){ return true; });
.focusin(function() {return true; } );
.focusout(function() {return true; } );
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1: move-top }
return true; // go on actions
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
With this code the click on the input functions, what is the behavior :
1- the $(".toc-target > input")
events are raised and return true which seems to do nothing lead to the normal selection of the radio button and event bubbles.
2- the H_titles gets his click event and it is executed it normally.
For now the focusin-focusout doesn't still function combined with the buttons I think that the problem comes from a conflict with the click (the fact that the header gets focus when clicked).
I have to clarify some ones about full ergonomics points and about compatibility (available on PC and Mobiles).
Another solution could be it seems "propagation" from H_title to the "input" but I have not found a good way to do everything needed into stuffxx and separate clearly the actions.
May be I am wrong or may be you have some suggestions to do it in a best way.
Best regards
Trebly
add a comment |
up vote
0
down vote
up vote
0
down vote
Thanks to charlietfi for help in this question.
I understand that my explanations were not sufficiently precise to understand the case. More I had introduced an error when copying code.
There is a true problem of which I have found a solution which reaches the target but I am not sure of both the explanation of why it was not functioning and why it functions now.
There where two steps of development :
1- Just execute stuff when a span into a header is clicked (and but not involved another stuff on focusin the element while shiftkey is pressed).
The HTML structure contains :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
The reason of the first two levels of SPAN is that it is done by two different pieces of soft and need two different classes.
The associated code which was functioning (since three years) was :
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
2- I need to had in some cases a radio button and do no perform stuff1 in such case (just add an input into the header) then the HTML code became :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
<input name="user_type" type="radio" value="adh">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
and I wrote the js code which do not functions:
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action of the click on the button
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
In my opinion the error seems that the radio button become not reachable into the H_title span while it is without code to manage the event. Note : this is the same for focusin actions and events.
If there is no Jquery code written for the click event everything is running normally.
//BEGIN
$(".toc-target > input")
.click( function(){ return true; });
.focusin(function() {return true; } );
.focusout(function() {return true; } );
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1: move-top }
return true; // go on actions
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
With this code the click on the input functions, what is the behavior :
1- the $(".toc-target > input")
events are raised and return true which seems to do nothing lead to the normal selection of the radio button and event bubbles.
2- the H_titles gets his click event and it is executed it normally.
For now the focusin-focusout doesn't still function combined with the buttons I think that the problem comes from a conflict with the click (the fact that the header gets focus when clicked).
I have to clarify some ones about full ergonomics points and about compatibility (available on PC and Mobiles).
Another solution could be it seems "propagation" from H_title to the "input" but I have not found a good way to do everything needed into stuffxx and separate clearly the actions.
May be I am wrong or may be you have some suggestions to do it in a best way.
Best regards
Trebly
Thanks to charlietfi for help in this question.
I understand that my explanations were not sufficiently precise to understand the case. More I had introduced an error when copying code.
There is a true problem of which I have found a solution which reaches the target but I am not sure of both the explanation of why it was not functioning and why it functions now.
There where two steps of development :
1- Just execute stuff when a span into a header is clicked (and but not involved another stuff on focusin the element while shiftkey is pressed).
The HTML structure contains :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
The reason of the first two levels of SPAN is that it is done by two different pieces of soft and need two different classes.
The associated code which was functioning (since three years) was :
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
2- I need to had in some cases a radio button and do no perform stuff1 in such case (just add an input into the header) then the HTML code became :
<h5>
<span class="toc-target" tabindex="1000"> <!-- puts the "target" on top -->
<span class="H_title">
<input name="user_type" type="radio" value="adh">
Adhérent
</span>
</span>
<span class="endof_tocid"></span>
</h5>
and I wrote the js code which do not functions:
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1 }
return true; // go on action of the click on the button
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
In my opinion the error seems that the radio button become not reachable into the H_title span while it is without code to manage the event. Note : this is the same for focusin actions and events.
If there is no Jquery code written for the click event everything is running normally.
//BEGIN
$(".toc-target > input")
.click( function(){ return true; });
.focusin(function() {return true; } );
.focusout(function() {return true; } );
$(".H_title")
.click(function(event) {
if ( ... ) { do stuff1: move-top }
return true; // go on actions
} )
.focusin(function() {...do_stuff2a);} );
.focusout(function() {...do_stuff2b);} );
//END
With this code the click on the input functions, what is the behavior :
1- the $(".toc-target > input")
events are raised and return true which seems to do nothing lead to the normal selection of the radio button and event bubbles.
2- the H_titles gets his click event and it is executed it normally.
For now the focusin-focusout doesn't still function combined with the buttons I think that the problem comes from a conflict with the click (the fact that the header gets focus when clicked).
I have to clarify some ones about full ergonomics points and about compatibility (available on PC and Mobiles).
Another solution could be it seems "propagation" from H_title to the "input" but I have not found a good way to do everything needed into stuffxx and separate clearly the actions.
May be I am wrong or may be you have some suggestions to do it in a best way.
Best regards
Trebly
answered Nov 12 at 15:55
Trebly
65
65
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%2f53251797%2fjquery-returns-true-to-event-handler-but-the-event-get-input-will-not-be-ended%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
Hard to understand what the issue is here. You mention click event but show code for focusing a class we have no idea what it is. Please provide a Minimal, Complete, and Verifiable example that reproduces your issue and a better explanation of the actual problem
– charlietfl
Nov 11 at 18:27
JQuery running is 1.12.4
– Trebly
Nov 11 at 18:33
Checked at the end when jquery-migrate (1.4.1) is reached in "jQuery.event.trigger" that "event" has "bubbles = false".. Others data of the event and linked elements found into object in debugger are OK.
– Trebly
Nov 11 at 18:41
The issue is that nothing happens.
– Trebly
Nov 11 at 18:45
Nothing happens to what? Without an actual example your question is very hard to comprehend and is confusing
– charlietfl
Nov 11 at 18:48