Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83469

HTML Snippet issues

$
0
0
I’m trying to add 2 seperate html snippet widgets to a page but I’m running into the issue than if I add the second snippet the first one stops functioning correctly. And if I take out the first one the second snippet still doesn’t work even though the code is correct. I’ve added alerts to the if statements on true values and the alert will fire but it always adds the character and never returns false for the second snippet. Has anyone else experienced this or have ideas on what could be the issue? I’m using the JQuery aspect of HTMLSnippet.   1) $(selector).on( "keyup", function(){ var th = $(this); th.filter( function(){ if ( th.val().length === 0 ) return th.val('0'); }) }) 2) $(selector).on( "keyup", function(e){ var th = $(this); th.filter( function(){ if ( e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57) ) return false; }) })  

Viewing all articles
Browse latest Browse all 83469

Trending Articles