locked
form submit not working in google chrom RRS feed

  • Question

  • User799396372 posted

    good day

    i have published my mvc4 application from visual studio ultimate 2012 to remote windows server 2016 IIS10.

    before publishing, all are working fine. but after publishing :

    in first time no redirectToAction working when submit, after, the form submiting not working

    and also the autocomplete using bootstrap typeahead not working and execution error message is desplayed

    Edit: i forgot telling that these problems occur in google chrome only after publishing, all work fine in the other navigators

    Why? and what's the solution? please

    Monday, February 3, 2020 2:24 PM

Answers

  • User799396372 posted

    finally,i could now knowing why, because a date format validation in google chrome. and proxy parameter
    i have implemented a data textbox validation by jquery validation plugin. and all work fine
    thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 4, 2020 10:51 AM

All replies

  • User475983607 posted

    Why? and what's the solution? please

    Most likely there are JavaScript and CSS file references errors.  Frankly, there is not much the community an do without the error message and sample code to reproduce the problem.

    Monday, February 3, 2020 2:33 PM
  • User753101303 posted

    Hi,

    And use for example F12 Network and/or F12 Console to see what happens for this http request and/or if your JavaScript fails. The first step is to see what actually happens (rather than what you want to happen doesn't).

    Monday, February 3, 2020 3:23 PM
  • User799396372 posted

    i forgot telling that these problems occur in google chrome only after publishing, all work fine in the other navigators

    Monday, February 3, 2020 5:58 PM
  • User475983607 posted

    i forgot telling that these problems occur in google chrome only after publishing, all work fine in the other navigators

    Again, there is not much we can do without the error and source code. 

    Monday, February 3, 2020 6:53 PM
  • User799396372 posted

    i don't know what can i tell more than in form submission, i see 200 status code in F12 tool, but there is not redirectToAction the form staying displayed

    my form is in view that referense its js /css files from layout

    there is myShared/_ layout.cshtml page

    <!DOCTYPE html>
    
    <html>
    <head>
        
        <meta name="viewport" content="width=device-width" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <title>@ViewBag.Title</title>
        @* reference styles *@
        <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
        <link href="~/Content/bootstrap-datetimepicker.min.css" rel="stylesheet" />
        <link href="~/Content/css/select2.min.css" rel="stylesheet" />
        @* reference scripts *@
        <script src="~/Scripts/jquery-2.2.3.min.js"></script>
        <script src="~/Scripts/modernizr-2.6.2.js"></script>
    </head>
    <body>
    @* bootstrap navbar *@ 
    <div>
    @if (ViewBag.Title == "Cadres Superieurs" || ViewBag.Title == null)
            {
                <div class="container-fluid">
                    
                    @RenderBody()
    
                </div>
            }
            else {
                <div class="container">
                    @if (ViewBag.Title != null)
                { 
                        <h2>@ViewBag.Title</h2>
                        <hr />
                }
    
                    @RenderBody()
    
                </div>
            }
            
        </div>
        <script src="~/Scripts/bootstrap.min.js"></script>
        <script src="~/Scripts/moment-with-locales.min.js"></script>
        <script src="~/Scripts/bootstrap-datetimepicker.min.js"></script>
        <script src="~/Scripts/select2.min.js"></script>
        <script src="~/Scripts/bootstrap3-typeahead.min.js"></script>
        @RenderSection("scripts", false)

    Monday, February 3, 2020 10:17 PM
  • User475983607 posted

    i don't know what can i tell more than in form submission, i see 200 status code in F12 tool, but there is not redirectToAction the form staying displayed

    It's far more helpful to see the the Actions and the Views.  A redirect returns a 302 from the server not a 200.  If you are getting a 200 then there's something else going on.

    Tuesday, February 4, 2020 1:12 AM
  • User799396372 posted

    all working fine in IE, Firefox after publish except chrome

    Tuesday, February 4, 2020 7:53 AM
  • User753101303 posted

    Obviously it is expected that submitting a form does work even in Chrome. This is really just a form level POST or are you using Ajax ? As pointed already a redirect shoul;d return a 3xx status not a 2xx status.

    Past this issue and the current guessing game I strongly encourage to get familiar with this kind of tools. With a bit experience it is much quicker to use this kind of tools to see what happens and how it differs from what you expect rather than  trying to guess even by reading code.

    So this is just a submit button ???

    Tuesday, February 4, 2020 8:49 AM
  • User799396372 posted

    finally,i could now knowing why, because a date format validation in google chrome. and proxy parameter
    i have implemented a data textbox validation by jquery validation plugin. and all work fine
    thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 4, 2020 10:51 AM