Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avalon.serialize出来的form为空字符串,而jQuery的serialize出来的结果是对的 #6

Closed
winterwhisper opened this issue Jul 18, 2014 · 1 comment

Comments

@winterwhisper
Copy link

html

<form ms-controller='article_form' ms-on-submit='articleAction'>
  <input type="hidden" ms-duplex='id'>
  <label for="title">title</label>
  <input type="text" id='title' name='title' ms-duplex='title'>
  <br>
  <label for="content">content</label>
  <textarea id="content" name='content' cols="60" rows="10" ms-duplex='content'></textarea>
  <br>
  <button>submit</button>
</form>

js

// ...
  var articleFormModel = avalon.define('article_form', function(vm) {
    vm.id = "";
    vm.title = "";
    vm.content = "";

    vm.articleAction = function(e) {
      avalon.post(vm.id == "" ? '/api/articles' : '/api/articles/' + id, 
                  avalon.serialize(this));
      e.preventDefault();
    };
  });
//...

请问是怎么回事呢?

@RubyLouvre
Copy link
Owner

已经修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants