I'm trying to create a simple text block that updates when 1 of 3 form fields is changed.
Here's my jQuery and it keep getting this error: TypeError: $(...).updateTitlePrefix is not a function
Can anyone tell me what i'm doing wrong here?
$ = jQuery.noConflict();
$(document).ready(function() {
$('#dataEntryForm\:studyId').updateTitlePrefix();
$('#dataEntryForm\:formNumberQualifier').updateTitlePrefix();
$('#dataEntryForm\:formVersionNumber').updateTitlePrefix();
});
// updates the titlePrefix when either the study#, form# or form version are changed
$.fn.updateTitlePrefix() = function() {
$(this).change(function() {
$('#dataEntryForm\:titlePrefix').text($('#dataEntryForm\:formNumberQualifier').text() + $('#dataEntryForm\:formVersionNumber').text() + $('#studyId').text())
});
}
Not sure if this is relevant, but i'm on jquery 1.3.2 because this is a JSF project and that's what is included in the Richfaces library.
method...