Home Web Front-end JS Tutorial Summary of methods for submitting data in ext form form_YUI.Ext related

Summary of methods for submitting data in ext form form_YUI.Ext related

May 16, 2016 pm 07:02 PM
ext form submit

EXT form ajax submission (default submission method)

Copy code The code is as follows:

1. function login(item) {
2.
3. if (validatorForm()) {
4. // Set the login button to disabled when logging in to prevent repeated submissions
5 . this.disabled = true;
6.
7. // The first parameter can be submit and load
8. formPanl.form.doAction('submit', {
9.
10. url : 'user.do?method=login',
11.
12. method : 'post',
13.
14. // If there is something other than a form Parameters can be added here. I am temporarily empty here, or you can omit the following sentence.
15. params: '',
16. form, the second one is the Ext.form.Action object used to obtain the json data passed from the server.
18. success: function(form, action) {
19.
20. Ext.Msg. alert('operation', action.result.data);
21. this.disabled = false;
22.
23. },
24. failure : function(form, action) {
25.
26. Ext.Msg.alert('Warning', 'Username or password is incorrect!');
27. // Login failed, reset the submit button to operable
28. this.disabled = false;
29.
30. }
31. });
32. this.disabled = false; }



Non-ajax submission of 2.EXT form




Copy code The code is as follows: 1. //Be sure to add the following two lines to implement non-AJAX submission form! onSubmit : Ext.emptyFn, submit : function() {
2. //Set the action address again
3. this.getEl().dom.action ='user.do?method=login'; this.getEl().dom.method = 'post';
4. //Submit
5. this.getEl().dom.submit();
6. },



Ajax submission of 3.EXT



2.
3. Ext.Ajax.request({
4. //Request address
5. url: 'login. do',
6. //Submit parameter group
7. params: {
8. LoginName:Ext.get('LoginName').dom.value,
9. LoginPassword:Ext. get('LoginPassword').dom.value
10. },
11. //Callback on success
12. success: function(response, options) {
13. //Get the response json string
14. var responseArray = Ext.util.JSON.decode(response.responseText);
15. if(responseArray.success==true){
16. Ext.Msg.alert ('Congratulations', 'You have logged in successfully!');
17. }
18. else{
19. Ext.Msg.alert('Failed', 'Login failed, please log in again' );
20. }
21. }
22. });

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

An in-depth discussion of the physical storage structure of the Linux ext2 file system An in-depth discussion of the physical storage structure of the Linux ext2 file system Mar 14, 2024 pm 09:06 PM

The Linuxext2 file system is a file system used on most Linux operating systems. It uses an efficient disk storage structure to manage the storage of files and directories. Before we delve into the physical storage structure of the Linuxext2 file system, we first need to understand some basic concepts. In the ext2 file system, data is stored in data blocks (blocks), which are the smallest allocable units in the file system. Each data block has a fixed size, usually 1KB, 2KB or 4

MySQL transaction processing: the difference between automatic submission and manual submission MySQL transaction processing: the difference between automatic submission and manual submission Mar 16, 2024 am 11:33 AM

MySQL transaction processing: the difference between automatic submission and manual submission. In the MySQL database, a transaction is a set of SQL statements. Either all executions are successful or all executions fail, ensuring the consistency and integrity of the data. In MySQL, transactions can be divided into automatic submission and manual submission. The difference lies in the timing of transaction submission and the scope of control over the transaction. The following will introduce the difference between automatic submission and manual submission in detail, and give specific code examples to illustrate. 1. Automatically submit in MySQL, if it is not displayed

Analyze the physical organization of the Linux ext2 file system Analyze the physical organization of the Linux ext2 file system Mar 15, 2024 am 09:24 AM

The Linuxext2 file system is one of the commonly used file systems in the Linux operating system and has good performance and stability. This article will analyze the physical organization of the ext2 file system in detail and provide some specific code examples to help readers better understand. 1. Overview of the ext2 file system The ext2 file system is the earliest second-generation extended file system on the Linux system. It has made certain improvements in the performance, reliability and stability of the file system. It mainly consists of super block, group scan

BinaryX is renamed FORM again, and the FOUR it gives to the community is about to soar? BinaryX is renamed FORM again, and the FOUR it gives to the community is about to soar? Mar 04, 2025 pm 12:00 PM

BinaryX's token name change: from BNX to FOUR, and then to FORM, the deep meaning behind strategic adjustments BinaryX recently changed the token symbol from $FOUR to $FORM, which has attracted widespread attention from the industry. This is not the first time BinaryX has changed its name, and its token symbol has undergone a transition from BNX to FOUR. This article will explore in-depth the strategic intentions behind this series of name change. 1. Token name change process and strategic considerations BinaryX initially launched the $BNX token based on the BNB chain in 2021 to support its Play-to-Earn (P2E) gaming ecosystem. In early 2024, in order to optimize the economic model, BinaryX divided $BNX and gradually expanded to GameF

Getting Started with Java Git: Exploring Version Control from Scratch Getting Started with Java Git: Exploring Version Control from Scratch Feb 23, 2024 am 10:25 AM

Introduction to git Git is a distributed version control system, which means that each developer has a complete copy of the code base on their computer. This is different from a centralized version control system (such as Subversion or Perforce), which only has a central code repository. The benefit of distributed version control is that it makes collaboration more efficient because developers can work offline and synchronize with the central code base later. Installing Git To use Git, you need to install it on your computer first. You can download the installer for your operating system from the official Git website. After the installation is complete, you can enter git --version in the command line to check whether the installation was successful. Git basic concepts repository: Git

Tips for implementing form validation and submission with PHP and UniApp Tips for implementing form validation and submission with PHP and UniApp Jul 06, 2023 am 10:57 AM

Tips for implementing form validation and submission with PHP and UniApp Introduction: When developing web pages or mobile applications, form validation and submission are essential functions. Form validation is used to check whether the data entered by the user conforms to specific rules, and submission saves or sends the data entered by the user to the server. This article will introduce the techniques of using PHP and UniApp to implement form validation and submission to help developers quickly implement front-end and back-end interaction functions. 1. PHP implements form validation. The following is a PHP form validation sample code for

What is the difference between ext3 and ext4 in Linux system? What is the difference between ext3 and ext4 in Linux system? Feb 19, 2024 am 11:48 AM

A file system is an organization method for files stored on storage devices such as disks. The Linux system can support a variety of currently popular file systems, including: EXT2, EXT3, EXT4, FAT, FAT32, etc. So what are the differences between ext3 and ext4 in Linux systems? The following is a detailed introduction. What is the difference between ext3 and ext4 in Linux systems? 1. Larger file system and larger files ext3: 16TB file system and maximum 2TB file; ext4: 1EB file system and maximum 16TB file. 2. Unlimited number of subdirectories ext3: 32000 subdirectories; ext4: unlimited number of subdirectories.

File system selection and optimization suggestions for building a web server on CentOS File system selection and optimization suggestions for building a web server on CentOS Aug 05, 2023 pm 03:35 PM

Introduction to file system selection and optimization suggestions for building a web server on CentOS: When building a web server, it is extremely important to select an appropriate file system and optimize it. This article will introduce the file systems commonly used when building web servers on CentOS and provide corresponding optimization suggestions. 1. File system selection XFS file system XFS is an advanced, high-performance log file system. It has fast and efficient file system recovery capabilities and excellent I/O operation performance for large-capacity storage. XFS versus large

See all articles