Send form data to server

2 posts, 0 answers
  1. Koen
    Koen avatar
    3 posts
    Member since:
    Oct 2012

    Posted 29 Oct 2012 Link to this post

    L.S.

    Using the demo on

    http://demos.kendoui.com/web/validator/index.html

    How do I send the form data to the server (preferably as json, but anything goes.) I assume that the magic must happen in:

    $("button").click(function() {
      if (validator.validate()) {
        status.text("Hooray! Your tickets has been booked!").addClass("valid");
    // right, so here we can save, post, the form data? But how?
    // something like save("http://address.to/server/path/","json","POST") ?
    } else { status.text("Oops! There is invalid data in the form.").addClass("invalid"); } });

    kind regards, Koen
  2. Koen
    Koen avatar
    3 posts
    Member since:
    Oct 2012

    Posted 29 Oct 2012 Link to this post

    Right ... old school form action:

    <form action="http://address.to/server/path" method="post">
        <ul>
            <li>
                <label>Label</label>
                <input ... />
            </li>
            ...
        </ul>
    </form>

    If the form validates, it is automatically send to the action. So all you need to do is enclose the form with the actual <form> tags.

    If I find out how to send the form data simply as a json, I'll let you know.

    (Sure: action="javascript:doAjaxHere(this);" will probably do the job, but that is not an easy json way. There's got to be a simple kendo solution.)
  3. Kendo UI is VS 2017 Ready
Back to Top