2

I use wtforms to handle forms. so i create form like this:

class ProfileForm(Form):
    firstName = TextField(_('firstName'), [validators.Required(), validators.Length(min=3, max=45)])
    lastName = TextField(_('lastName'), [validators.Required(), validators.Length(min=3, max=45)])
    avatar = FileField(_('avatar'), [check_file])

this form work in simple upload fine ... but what about ajax ?

is there any plugin to create iFrame or somethings to upload file via ajax? or i must handle this form in another way?

ps: IE support be important

ps2: i use wtform for another without file in ajax to. just by serialize form and submit it ...

Paco
  • 4,520
  • 3
  • 29
  • 53
Mohammad Efazati
  • 4,812
  • 2
  • 35
  • 50

1 Answers1

1

You should try installing and using Flask-Sijax. It uses JQuery and AJAX.

http://packages.python.org/Flask-Sijax/

It also has an example on uploading via AJAX.

Dexter
  • 6,170
  • 18
  • 74
  • 101