Didn't works either ...
Here is the solution I had found. Instead use the toggle() function,
which cause this issue, I use the click() function with an if()
statement.
function myToggle(checkboxElem, showHideElem){
var showHide = $(showHideElem);
var checkbox = $(
Yeah, it was a bit thoughtless of me to suggest it (tired!).
Try this instead...(untested)...
function myToggle(toggleElem, showHideElem){
var showHide = $(showHideElem);
$(toggleElem).toggle(
function(){ showHide.show('slow'); toggleElem.checked = !
toggleElem.checked; },
function(){
I also have tried, like you suggested, to use the .each() function.
function myToggle(toggleElem, showHideElem){
var showHide = $(showHideElem);
$(toggleElem).toggle(
function(){ showHide.show('slow');},
function(){ showHide.hide('slow');}
Sorry Wizzud, but your code didn't works either, the checkbox is
checked every time.
I have also try in different way like this and this make me crazy !:
function myToggle(toggleElem, showHideElem){
var showHide = $(showHideElem);
$(toggleElem).toggle(
function(){
function myToggle(toggleElem, showHideElem){
var showHide = $(showHideElem);
$(toggleElem).toggle(
function(){ showHide.show('slow'); },
function(){ showHide.hide('slow'); } )
.each(function(){ this.checked = !this.checked; });
}
On Nov 2, 12:21 pm, Snook <[EMAIL PROTECTED]> wrote
> Calling toggle() runs event.preventDefault.
> Whatever you want the click to do, you need to code it yourself.
Ok, thanks.
I have tried different implementation of preventDefault, regarding
what I have found in this group. And probably I'm completely wrong
because no one works for me.
Here is
Calling toggle() runs event.preventDefault.
Whatever you want the click to do, you need to code it yourself.
On Nov 1, 9:44 am, Snook <[EMAIL PROTECTED]> wrote:
> Thanks a lot Wizzud. This works fine.
>
> But did you have an idea why the checkbox didn't display the check
> mark when there are che
Thanks a lot Wizzud. This works fine.
Regards,
Damien
Thanks a lot Wizzud. This works fine.
But did you have an idea why the checkbox didn't display the check
mark when there are checked ?
The checkbox are used to run the toggle function.
Damien
Something along the lines of ...?
function myToggle(toggleElem, showHideElem){
var showHide = $(showHideElem);
$(toggleElem).toggle(
function(){ showHide.show('slow'); },
function(){ showHide.hide('slow'); } );
}
myToggle('#regime_ltn_c', '#regime_ltn');
On Oct 31, 2:51 pm, Snook <[E
10 matches
Mail list logo