How to serialize html form in dart as a string for submission

Viewed 356

In jQuery, there is a function to serialize a form element so for example I can submit it as an ajax request.

Let's say we have a form such as this:

<form id="form">
 <select name="single">
  <option>Single</option>
  <option selected="selected">Single2</option>
 </select>

 <input type="checkbox" name="check" value="check1" id="ch1">
 <input name="otherName" value="textValue" type="text">
</form>

If I do this with the help of jquery

var str = $( "form" ).serialize();
console.log(str);

the result would be

single=Single2&check=check1&otherName=textValue

Is there such functionality in dart's FormElement or I have to code it myself? Thanks.

2 Answers
Related