How does the TP framework save the original data after it is submitted refreshed?

Source: Internet
Author: User
For example, how to save data in a text box when the page is refreshed when the content is not legally submitted? No frame I know how to save with TP do not know how to save the data is saved with a session? If the submission does not pass the data back to the front end?

Reply content:

For example, how to save data in a text box when the page is refreshed when the content is not legally submitted? No frame I know how to save with TP do not know how to save the data is saved with a session? If the submission does not pass the data back to the front end?

Submitted data, in the controller can get it, and then error in the control, then the data assign to the template, it should be able to meet your needs, there is, in the JS submitted form or AJAX, stored in the Localstrage, controller error, jump to the template, It is also possible to read the data from the Localstrage.
It is best to let the user submit the data after the foreground is verified, but the server-side verification is necessary.

  • The form comes with the ability to submit an unsuccessful save data! There are, of course, some form options that are not refreshed with a dropdown box like the one below.

  • Do you mean to verify that it must be submitted to the server? Does the front end js do not validate? If you have to do a validation on the server and want to submit a failure to save the original data, then the data you submitted failed to render the form again, but I think this is not worth the candle. I recommend that you directly use ajax the send data to the server side to verify the wedding return front tips. So the user experience is good. Hope to help you

  • 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.