In an imperial interview when the question of this topic: How to deal with post submission duplication problem, and then with the @ warm Yang Exchange, he said record time, I did not understand, I think is to use the session in the form page record, and then submit the page to judge, if equal is considered successful, and empty session, But the question is, what if the form page is HTML? Do you want to make a PHP-validated page? Similar to the functio
In JavaScript, there are two ways to block the default submission behavior of a form, namely:
(1) return False
Sample code
(2) using Preventdefault ()
In standard browsers, the default behavior of the browser is blocked, event.preventDefault() and in ie6~8, returnValue attributes are used to implement it.
Sample code
These are the full contents of the two methods that use JavaScript to block form submissions, and hopefu
This article illustrates the jquery implementation form form based on Ajax without a refresh submission method. Share to everyone for your reference, specific as follows:
First, create a new login.html page:
Then, create a new login.aspx to receive and process the data:
Add: Form uses AJAX to submit a complete instance:
Convert form to Ajax commit
function Ajaxsubmit (URL,FRM,FN) {
var datapara=getformjson (frm);
$
1,sumbit form Submission
WebForm1.aspx Source:
Copy Code code as follows:
Submitform.ashx Source:
Copy Code code as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Namespace Netformdemo.ashx
{
Summary description of SubmitForm
public class Submitform:ihttphandler
{
public void ProcessRequest (HttpContext context)
{
Context. Res
Before their own forum because the program source code with the WIN2000 registry conflict, Post issued will appear invalid page, so that the forum has a lot of malicious repeated posts, and then came up with a way to avoid duplication with JS submission, the following is part of the source code:
Here's what you want to submit.
With this code, the Forum's repeated posts are significantly reduced, but there is a drawback, is to refresh once, the
Compatible: Mobile devices such as ie6+, Firefox, Chrome, Safari, opera, and ipad. And IE6 can also support the modern browser static positioning (fixed), overlay Drop-down control, alpha channel PNG background.
Step into the business:
Artdialog A nice pop-up box control
Contact Artdialog has been for some time, think it is good to use, more lightweight, JavaScript plug-ins I prefer lightweight, fast loading.
Its function is also very good, full-featured, compared to other pop-up plug-ins,
Jbox is a good dialog box component.
When you use Jbox in the ASP.net Form, you will find that you cannot eject the dialog box problem in the client click event that the button registers.
The performance of the page as a flash on the submission, resulting in a dialog box flashed, or even can not see. Cause the modal dialog box to fail.
First, the button will have the default processing, for the ordinary ASP.net button, will cause the form to submit, s
This article describes the disabled problem of Web Form submission JS solution. Share to everyone for your reference. The specific analysis is as follows:
For example, like the following form
Copy Code code as follows:
When we submit the form, we cannot get pname data in the background because the property of the input box disabled. That is, can save the value can also keep the user can not enter this feature has the following solutio
Copy code code as follows:
$j (" Form "). Submit (function () {
if ($txt = =" Submit ") {
this.action=" doaddmessage.action?button= submit ";
This.submit ();
}else{
this.action= "doaddmessage.action?button= save";
This.submit ();
}
});
} For example: There are two picture buttons on the page The submission, we can give them all binding the OnClick event at this time, this time we use jquery's form form to
In the MVC area to implement the post submission data js writing!
Copy Code code as follows:
$ ("#btnSava"). Click (function () {
if ($ ("#text"). val () = "") {
Alert ("Please enter what you want to say!") ~! ");
} else {
$.post ("/control/action", {ID: $ ("#text"). Val ()}, function (data) {
if (data = = 0) {
Alert ("Successful publication, we will inform the Distributor to reply as soon as possible");
Window.location.reload ();
el
plug-in in return, tab and other important event mechanisms, such as change, if your input is in a form, carriage return from the original selected items into the input into the direct Submission Form form, this is not what we want.
The principle of my method is to add an original plug-in trigger query event, when the input column occurs when characters change, requery (call its internal onchange function), here mainly for Firefox, because our system
Introduction: After switching the Subversion server address, a problem occurred that failed to submit the code correctly Org.apache.subversion.javahl.ClientException:svn:E200007:Commit failed ( Details follow), how to solve it.
1. Background information
The Subversion server address was switched on the machine because of the project needs, but there was an error that could not be committed at the time of the code submission on the new Subversion serve
, although there are webmaster news, interviews, parties, leisure these classifications, but not for us to stay. Here first the Novice tutorial and net earn these two categories, the Novice tutorial is basically the need for an illustrated article, we are a novice, the current many programs, the operation of the novice tutorials are almost all written, in the 000webhost and Host1free These free space out of time when someone dedicated to write these graphics and text tutorials and contributions,
The submission of a form that has recently written SPRINGMVC, JSP is as follows:
departure city: arrival City: toward nbsp;nbsp;nbsp;nbsp; nbsp;nbsp;nbsp; return: Passenger type:
The runtime throws 404, and the path becomes http://localhost:8080/springMVC/views/servlet/GetProductId/test
This path is obviously wrong, where SPRINGMVC is the project name, and views are the folders of the JSP. The original SPRINGMVC in the a
put the previous form of the cache, submitted to the background, causing the background and insert a piece of data.
The solution is to use Redirect to an action, which clears out all parameters and does not repeat the commit.
So what exactly is the reason for repeating the submission?
The first thing you have to figure out is: What address does the browser request when we refresh again? When a form is submitted to an action for the first time, the
We encounter countless forms on the Internet every day, and most of them do not restrict users from submitting the same form multiple times. The lack of such restrictions can sometimes produce unexpected results, such as repeating a subscription to a mail service or repeating a ballot. Perhaps some ASP beginners are not clear how to limit the repeated submission of the same form in ASP applications, so here we introduce a simple way to prevent users f
4. How to open a new window after submitting the form to display the results of the submission.
If you have a mailing list service on your site, each time a visitor subscribes and presses the Subscribe button. Because the mailing list requires subscription determination, which is provided by third parties, the subscription determination page connects to the service provider's page. This sometimes shines as a visitor leaves the site. You can set the f
This article is mainly on the jquery plug-in easyui form validation submission of the sample code is introduced, the need for friends can come to the reference, I hope to help you. Code as follows: code as follows://Form Submit $ (' #myForm '). Form ({ NBSP;url: '/processservlet ', onsubmit:function () { return $ (this). Form (' Validate '); NBSP, success:function (data) { alert (data); nbsp NBSP} nbsp});
HTML markup Language. After using the User Name text box to gain focus, the SendKeys function simulates the keyboard to send a TMP string to the text box so that the username is completed and the return key is sent to submit the form. For the use of the SendKeys function, you can consult MSDN help.
The second conditional statement first determines whether the change page is a personal data fill the page, and then fill out the personal data, the method and fill in the same user name, get a text
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.