Form submission and ajax form submission

Source: Internet
Author: User

Form submission and ajax form submission

[Source of the article] Because I have little research on form, I have always used AJAX for submission. This time, I proposed to use form for submission in the background. By the way, I will study it in depth. Before I made a form, it is found that the input can call different mobile keyboards by setting different types. However, you do not know how to control the [Search] and [go] on the keypad.

[Difference between form and ajax]

Ajax submission uses js to submit requests. Both requests and responses are processed by the js engine, and the page is not refreshed. the user does not feel that the browser actually sends a request. If we want to change partial page content, refreshing with Ajax will not cause the whole page to be reloaded, and the interaction is good.

With AJAX, the user experience on the Web is more agile: the data submission page does not flash the screen, the page is updated quickly locally, and the network bandwidth usage is low.

Compared with the traditional mode, AJAX development is simpler: In the traditional mode, when a form is submitted, the entire page is re-painted. In order to maintain the status change of the page user, more code is required. You need to pass more parameters between the Controller and the template to maintain the page status. AJAX does not, because the page is only partial update, and does not affect the content of other parts of the page.

Compared with the traditional mode, AJAX development is difficult: You need to understand and be proficient in JavaScript, while JavaScript has many obstacles such as debugging troubles and browser compatibility. However, this is no longer a difficult issue.

[1] Ajax is asynchronous during submission, request, and receipt, without refreshing webpages. Form submission creates a page, even if it is submitted to itself, it also needs to be refreshed. [2] When Ajax is submitted, a new request is created in the background; while Form is, the page is abandoned and then requested; [3] Ajax must be implemented using JS. If a JS browser is not enabled, the operation cannot be completed. Form is the instinct of the browser. Form can be submitted whether or not Javascript is enabled; [4] Ajax uses a program to process the data during the process of submission, request, and receipt. When a Form is submitted, it is automatically completed according to your Form structure, no code intervention is required;

[About how to call the keyboard]

Currently, the traditional form submission method has been tested, and the soft keyboard can be called. The function is the same as that when you click submit directly. It is worth noting that you can click the soft keyboard to submit the form, but the submit button in the form itself will not be triggered, that is, clicking "Search" or "go" on the keyboard does not trigger the "Submit" button.

Ajax has not yet found a method for calling the soft keyboard.

[Summary of input attribute type test in person on April 9]

The property is = email =, And the email keyboard is called.

The property is = url =, and the web address keypad is called.

The property is = search =, And the keyboard with the [search] button is called.

Property = tel =, call the full-digit keyboard

The property is = number =. Call a digital keypad with pinyin.

Summary: This part is a note record that makes it easier for me to view

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.