?
Solved

asp.net mvc4

Posted on 2015-02-16
3
Medium Priority
?
121 Views
Last Modified: 2015-02-17
Hi All,

I Implemented webapp with asp.net mvc4.

I have form with submit button that when users click on it they save all the data they filled up in the form. what I would like to do is when user click on submit then submit will grey out or disable until the process of saving data finish. The issue I experience now is users click on submit many times and created duplicated data.

Here is what I was trying to do:

this.disabled = true; this.value = 'Creating PO, please wait....'; this.form.submit()

This code above works but he doesn't save all my form as in my server side i need to pass param.

Here is my submit button:

<input type="submit" name="command" value="Submit" id="Submit" class="btn btn-sm btn-primary" />
0
Comment
Question by:Moti Mashiah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40614206
If you are concerned with multiple submits, you could also do a redirect to an action, which will lose track of the post.

Redirect After Post
http://www.theserverside.com/news/1365146/Redirect-After-Post
0
 
LVL 25

Accepted Solution

by:
apeter earned 2000 total points
ID: 40614604
Hope below jquery helps you. It displays an alert on second click. Or  you can change the code to do something else if you want.

var tryNumber = 0;
 jQuery('input[type=submit]').click(function (event) {
     var self = $(this);

     if (self.closest('form').valid()) {
         if (tryNumber > 0) {
             tryNumber++;
             alert('Your form has been already submited. wait please');
             return false;
         }
         else {
             tryNumber++;
         }
     };
 });
0
 
LVL 1

Author Closing Comment

by:Moti Mashiah
ID: 40614920
thanks solved
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question