﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13521	admin inline max_num option doesn't work as intended	Rolando Espinoza La fuente	nobody	"Hi, first of all sorry for my english :)

I just tested with inline example in django docs:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects
(using django's git mirror svn13230)

{{{
#!python
class BookInline(admin.TabularInline):
    model = Book
    extra = 1
    max_num = 10

class AuthorAdmin(admin.ModelAdmin):
    inlines = [
        BookInline,
    ]
}}}

But on admin interface, the ""Add another book"" link disappear on the first click, showing only 2 inline forms.

I believe that's because this line on inlines.js script:
{{{
#!javascript
if ((maxForms.val() != '') && (maxForms.val() <= totalForms.val())) {
}}}

val() function returns string, resulting ""10"" <= ""2"" which is True in javascript.

I've attached a little patch that uses same approach as showAddButton logic.

PD: If you apply the patch for test purpose, don't forget to overwrite/update inlines.min.js!"		closed	contrib.admin	dev		fixed	max_num inlines		Accepted	1	0	0	0	0	0
