Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Created March 3, 2012 04:10
Show Gist options
  • Save elijahmanor/1964298 to your computer and use it in GitHub Desktop.
Save elijahmanor/1964298 to your computer and use it in GitHub Desktop.
Find the jQuery Bug #8: Problem
<form id="personForm" name="personForm" method="post"
action="/Demo/jsf/main.jsf;jsessionid=0596FB948C236D0FFC162223"
enctype="application/x-www-form-urlencoded">
<div class="field">
<label>Last Name</label>
<input id="personForm:lastname"
name="personForm:lastname" type="text" />
</div>
<div class="field">
<label>First Name</label>
<input id="personForm:firstname"
name="personForm:firstname" type="text" />
</div>
<div class="field">
<label>Address</label>
<input id="personForm:address"
name="personForm:address" type="text" />
</div>
<!-- ... more HTML ... -->
</form>
// <input id="person.name" name="person.name" type="text" />
$( "#person.name" ).addClass( "highlight" ); // Fail
// <input id="person:name" name="person:name" type="text" />
$( "#person:name" ).addClass( "highlight" ); // Fail
// <input id="person$name" name="person$name" />
$( "#person$name" ).addClass( "highlight" );​ // Fail
$( document ).ready( function() {
$( "#personForm:firstname" ).addClass( "required" );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment