The only thing I can see in that script that might cause a problem in
1.2 is .find('li/label'), which you can change to .find('li >
label') . Aside from that, there is a bunch of DOM scripting that
could be reduced quite a bit by converting it to jQuery.
Hope that helps get you started.
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Sep 16, 2007, at 3:23 PM, stef wrote:
an article on a list apart describes how to use jquery to nicely lay
out a form. since it doesnt work with jquery 1.2 i just grabbed the
jquery version he uses from his source (http://www.alistapart.com/d/
prettyaccessibleforms/example_3/assets/js/jquery.js)
now im also using the the bassistance plugin to validate the form.
this plugin doesnt work with the jquery version thats used in the ALA
article so im using the latest jquery version for this. so i need to
link to both versions, but this causes the bassistance plugin to stop
working (firebug: $("#newsletterForm").validate is not a function).
strange, cause mr bassistance uses the ALA technique to lay out his
demo forms ...
can anyone suggest why and or how to fix this?
in case some one wants to figure out why the ALA script doesnt work
with jquery 1.2, here it is:
if( document.addEventListener )
document.addEventListener( 'DOMContentLoaded', newsletterForm,
false );
function newsletterForm (){
// Hide forms
$( 'form.newsletterForm' ).hide().end();
// Processing
$( 'form.newsletterForm' ).find( 'li/
label' ).not( '.nocmx' ).each( function( i ){
var labelContent = this.innerHTML;
var labelWidth = document.defaultView.getComputedStyle( this,
'' ).getPropertyValue( 'width' );
var labelSpan = document.createElement( 'span' );
labelSpan.style.display = 'block';
labelSpan.style.width = labelWidth;
labelSpan.innerHTML = labelContent;
this.style.display = '-moz-inline-box';
this.innerHTML = null;
this.appendChild( labelSpan );
} ).end();
// Show forms
$( 'form.newsletterForm' ).show().end();
}