---
title: "How to posting data from Jquery Form"  
description: "How to posting data from Jquery Form"  
author: "Anonymous User"  
published: 2015-02-05  
updated: 2015-02-05  
canonical: https://www.mindstick.com/forum/12947/how-to-posting-data-from-jquery-form  
category: "asp.net"  
tags: ["jquery", "web"]  
reading_time: 2 minutes  

---

# How to posting data from Jquery Form

I have a [simple](https://yourviews.mindstick.com/story/1469/5-simple-ways-to-stay-fit-amp-healthy) [jquery form](https://www.mindstick.com/forum/158279/what-is-jquery-form-validation) which gets the input from user and posts the data to another page and displays a [success](https://www.mindstick.com/articles/12957/best-tips-to-make-your-ghostwriting-experience-a-success) message. But my [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is the data doesn't get posted to the other page, instead the [error message](https://www.mindstick.com/forum/23174/error-message-the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration) gets popped up.

**Here is my Jquery:**

```
 $(document).ready(function () {     $("#register").click(function () {    var name = $("#name").val();    var email = $("#email").val();    var password = $("#password").val();    var cpassword = $("#cpassword").val();    if (name == '' || email == '' || password == '' || cpassword == '') {        alert("Please fill all fields...!!!!!!");    } else if ((password.length) < 8) {        alert("Password should atleast 8 character in length...!!!!!!");    } else if (!(password).match(cpassword)) {        alert("Your passwords don't match. Try again?");    } else {             $.ajax({             type:"POST",            url: "SignUp.aspx/register",  //trying to post to this url            data: { firstName: name },             success: function (msg) {                alert("Success");   // Success message which should pop up if successful            },            error: alert("Failed")   //error message which should pop up if there is an error        });    }});});
```

Here is the code in signup.aspx page ([code behind](https://www.mindstick.com/forum/2199/call-javascript-s-function-from-code-behind) [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp)):

```
         public string register(String firstName)         {            return "Success";                     }
```

The url i have provided is correct there is no problem with that. What might be the problem here ?

Also are there another [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) to send data to another page?

Thank you for your time

## Replies

### Reply by Manoj Bhatt

This

```
        success: function (msg) {            alert("Success"); // Success message which should pop up if successful        },        error: alert("Failed") //error message which should pop up if there is an error    });Should be:        success: function(msg) {            alert("Success");        // Success message which should pop up if successful        },        error: function(){alert("Failed")}       //error
message which should pop up if there is an error    });
```

You could have additional errors though.


---

Original Source: https://www.mindstick.com/forum/12947/how-to-posting-data-from-jquery-form

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
