boy18nj (112) [Avatar] Offline
#1
input tag is defined as-


<span class="value">
<input id="employeeDateSearch:j_id22:ssn" type="text" name="employeeDateSearch:j_id22:ssn"/>
</span>


Event binding is done as follows-

<script type="text/javascript">
$(function(){
$('#employeeDateSearch:j_id22:ssn')
.bind('click', function(event){say('BOOOM input')});
});

</script>


If I click inside input field, nothing happens.
boy18nj (112) [Avatar] Offline
#2
Re: onclick event not firing?
It turns out, jQuery selector is unable to find out id name when it contains colon.

Is there workaround around it, i guess it may be regular expressions to the rescue.
boy18nj (112) [Avatar] Offline
#3
Re: onclick event not firing?
It worked using this-


$(function(){
$("span input[id$='employeeDateSearch:j_id22:ssn']")
.bind('click', function(event){say('BOOOM input')});
});