Dart: AJAX form submit

后端 未结 1 1170
悲&欢浪女
悲&欢浪女 2021-01-20 19:21

Please note: I am not interested in using Polymer for this; I want to use \"pure\" Dart!

I am trying to build a simple sign-in screen for my Dart ap

相关标签:
1条回答
  • 2021-01-20 19:55

    here is an example how to do this

    Forms, HTTP servers, and Polymer with Dart

    When you change

    void main() {
        querySelector("#signinBtn")
            ..onClick.listen(handle);
    }
    

    to

    void main() {
        querySelector("form")
            .onSubmit.listen(handle);
    }
    

    you have access to target

    void handle(Event event) {
        event.preventDefault();
    
        FormElement form = event.target as FormElement;
    
        ...
    }
    
    0 讨论(0)
提交回复
热议问题