@@ -223,12 +223,18 @@ test("jQuery.ajax - dataType html", function() {
223223test ( "serialize()" , function ( ) {
224224 expect ( 5 ) ;
225225
226+ // Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
227+ jQuery ( "#search" ) . after (
228+ '<input type="email" id="html5email" name="email" value="dave@jquery.com" />' +
229+ '<input type="number" id="html5number" name="number" value="43" />'
230+ ) ;
231+
226232 equals ( jQuery ( '#form' ) . serialize ( ) ,
227- "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&select1=&select2=3&select3=1&select3=2" ,
233+ "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43& select1=&select2=3&select3=1&select3=2" ,
228234 'Check form serialization as query string' ) ;
229235
230236 equals ( jQuery ( '#form :input' ) . serialize ( ) ,
231- "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&select1=&select2=3&select3=1&select3=2" ,
237+ "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43& select1=&select2=3&select3=1&select3=2" ,
232238 'Check input serialization as query string' ) ;
233239
234240 equals ( jQuery ( '#testForm' ) . serialize ( ) ,
@@ -240,14 +246,15 @@ test("serialize()", function() {
240246 'Check input serialization as query string' ) ;
241247
242248 equals ( jQuery ( '#form, #testForm' ) . serialize ( ) ,
243- "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&select1=&select2=3&select3=1&select3=2&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=" ,
249+ "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43& select1=&select2=3&select3=1&select3=2&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=" ,
244250 'Multiple form serialization as query string' ) ;
245251
246252 /* Temporarily disabled. Opera 10 has problems with form serialization.
247253 equals( jQuery('#form, #testForm :input').serialize(),
248- "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&select1=&select2=3&select3=1&select3=2&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
254+ "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43& select1=&select2=3&select3=1&select3=2&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
249255 'Mixed form/input serialization as query string');
250256 */
257+ jQuery ( "#html5email, #html5number" ) . remove ( ) ;
251258} ) ;
252259
253260test ( "jQuery.param()" , function ( ) {
0 commit comments