Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6179585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:41:37+00:00 2026-05-24T00:41:37+00:00

I am using asp.net MVC and I am having an issue posting a form

  • 0

I am using asp.net MVC and I am having an issue posting a form using jquery.
It is not posting to the url I am telling it to.
If I use firebug, it shows the post happening but it is posting to the index of the controller everytime. I cannot figure out why. I have verified the url of the action I am trying to post but I can’t figure out why it is always posting to the index of the controller….Note: the view in which the form is found IS the index view. so Basically it is posting to it’s own action rather than the one in the url i am telling it to. Any help would be great. thanks!

here is my form

 <form  action='' id="descriptionForm">
<%=Html.Hidden("claimNumber", ViewData["claimNumber"])%>
<%=Html.Hidden("partNumber", ViewData["partNumber"])%>
<%=Html.Hidden("qty", ViewData["qty"])%>
<table>
    <tr>
        <td style="text-align: right">
            Category:
        </td>
        <td>
            <%=Html.DropDownList("problemCategory", (IEnumerable<SelectListItem>)ViewData["problemSelect"], "-Select-")%>
        </td>
    </tr>
    <tr>
        <td style="text-align: right">
            Details:
        </td>
        <td>
            <select id="problemDetails">
            </select>
        </td>
    </tr>
    <tr>
        <td style="text-align: right">
            Dealer Notes:
        </td>
        <td>
            <%=Html.TextArea("dealerNotes", "", 3, 40, null)%>
        </td>
    </tr>
</table>
<div style="position: absolute; bottom: 8px; right: 8px">
    <input type="button" id="itemDetailsCancel" value="Cancel" />
    <input type="submit" id="itemDetailsSubmit" value="Save" />
</div>
</form>
 <a href='<%=ResolveUrl("~/Warranty/WarrantyClaims/CompleteAddLineItemToClaim/") %>'
id="CompleteLineItemUrl"></a>

Here is my Javascript

   $("#descriptionForm").submit(function () {
    var completeurl = $("#CompleteLineItemUrl").attr('href');
    var data = $(this).serialize();

    $.post({
        type:'POST',
        url: completeurl,
        data: data,
        success: function (result) {
            alert("done");
        }
    });
    return false
});

and just for good measure here is the controller action I am trying to post to(though it doesn’t do much yet)

  [HttpPost]
    public ActionResult CompleteAddLineItemToClaim(string claimNumber, string partNumber, string qty, string problemCategory, string problemDetails, string dealerNotes)
    {
        var result = new { result = "done" };

        return Json(result, JsonRequestBehavior.AllowGet);
    }

Update:
updated javascript

$(function(){

        $('#descriptionForm').submit(function () {
            var completeurl = $('#CompleteLineItemUrl').attr('href');
            var data = $(this).serialize();

            $.ajax({
                type: 'POST',
                url: completeurl,
                data: data,
                success: function (result) {
                    alert('done');
                }
            });
            return false;
        });

 });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:41:39+00:00Added an answer on May 24, 2026 at 12:41 am

    Is the form itself loaded by an ajax call?

    If so you need to use the live() function of jquery.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET MVC + jQuery : I need to use some values owned by
I am having a weird issue in ASP.NET MVC with objects not being updated
I'm having an issue with my ASP.Net MVC application, I'm using MVC 3 with
I am having an issue on the controller side using ASP.Net MVC 3 trying
I'm using ASP.NET MVC + NHibernate + Fluent NHibernate and having a problem with
I am currently using ASP.NET MVC 2.0 RC2, having recently moved from version 1.0.
I am wondering what experiences people are having using the ASP.NET MVC Framework? In
We're going through an ASP.Net MVC book and are having trouble with using an
Using ASP.NET MVC there are situations (such as form submission) that may require a
I'm having a problem with JQGrid using ASP.NET MVC. I'm trying to follow this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.