Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rasmus Thyssen 14 posts 63 karma points
    Nov 07, 2014 @ 14:21
    Rasmus Thyssen
    0

    First time submit fails when input is mandatory

    I have a strange error and i can't find out why it happens.

    I have a website running umbraco 6.2.4 webforms and i have installed Contour 3.0.23.

    I have created a form with one or more mandatory fields, and render it through a makro using the RenderForm usercontrol.

    First time i submit the form with all the fields including the mandatory fields filled out. The form posted with the correct response, but i still get an error from the validation saying that all mandatory fields was empty, and needs to be filled out....... which they where. - There is no entry saved in Contour.

    All future submits will work, without any problems.

    I have tried my best to search for the problem, but with no luck. So is there anyone that have seen this problem before and maybe can help me, or point in some direcetion where to look.

    Best regards Rasmus

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 07, 2014 @ 14:25
    Jan Skovgaard
    0

    Hi Rasmus and welcome to our :)

    Do you get any error messages in your browser console log / network log when you do the initial post?

    I have seen this issue before but it's been a while and I can't remember how I dealt with it back then. But perhaps you need to change the way Contour is calling jquery.validation etc.

    Looking forward to hearing from you.

    /Jan

  • Rasmus Thyssen 14 posts 63 karma points
    Nov 07, 2014 @ 15:40
    Rasmus Thyssen
    0

    Hi Jan - Thank you for your fast answer :)

    There is no error messages or anything. I have checked the data that is being posted, and that looks correct.

    I have tried to remove jquery.validate - but it didnt change anything, and the validation still worked.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 07, 2014 @ 16:09
    Jan Skovgaard
    0

    Hi Rasmus

    You're welcome :)

    Hmm, if you remove jquery.validate...and you still see the validation errors...then it sounds like it's being included twice?

    Do you include it yourself as well? It's being fetched in the Contour view when you use a Contour form.

    /Jan

  • Rasmus Thyssen 14 posts 63 karma points
    Nov 10, 2014 @ 09:45
    Rasmus Thyssen
    0

    Hi Again.

    I thought that it was the validation that was the problem. But now I have testet the form without any mandatory fields. And it still wont work.

    When i submit the form, the page post, and it just give me the same page, but with the imput filed empty and the form wasent send.

    So it must be some serverside error. If i submit the form again, its a success. (same data applied)

    Best regards Rasmus

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 10, 2014 @ 10:48
    Jan Skovgaard
    0

    Hi Rasmus

    Do you see any errors in your browser console log or in the network tab when doing the initial submit?

    /Jan

  • Comment author was deleted

    Nov 10, 2014 @ 11:25

    Could it be that you have nested form tags? So it might be submitting the surrounding form

  • Rasmus Thyssen 14 posts 63 karma points
    Nov 10, 2014 @ 12:39
    Rasmus Thyssen
    0

    Jan: I get no errors, not in consoloe or in the header response or anything.
    The Headers response from the form includes the text that i have inserted in the textfields. - But it still returns a page with a empty form.

    Hello Tim, thank you for the answer.. 
    I just checked for any surrounding forms of any kind, but there is only 1 form on the page. 

     

  • Comment author was deleted

    Nov 10, 2014 @ 12:43

    Ok in that case could you send a backup of the site to tg at umbraco dot com then I can take a detailed look 

  • Comment author was deleted

    Nov 10, 2014 @ 12:47

    Must say it's been a while since we tested the usercontrol macro since that is obsolete , will give it a try now

    Isn't it an option to use the razor macro? That will also work on your webforms site

  • Comment author was deleted

    Nov 10, 2014 @ 12:54

    So since the usercontrol macro has been obsolete for over 2 years I would suggest that you use the razor one (that way you can also take advantage of all features like conditions)

  • Comment author was deleted

    Nov 10, 2014 @ 12:59

    Just tested the usercontrol one (on same umbraco version as you are running) and it works like it. So might be something on your templates that is interfering

    You could create a super basic template and see if you still have the issue there and then work your way up to the culprit

  • Rasmus Thyssen 14 posts 63 karma points
    Nov 12, 2014 @ 14:57
    Rasmus Thyssen
    0

    Hi again Tim

    I have now tried some of your suggestions.

    I've tried to create a clean template - and then i dont get the error. But since then i've used several hours to find the reason, and i still can't find a legit reason. Its still quite buggy.. it keeps showing the same error once in a while :(

    I cant use the Razor file, because im using contour as a Macro in the Richtexteditor. Then the page admin, can choose between wich forms he wants on different pages. I would like to try not using the usercontroll though. Any idea how to make that work as a Umbraco Macro in the richtexteditor.

    Best regards Rasmus

  • Comment author was deleted

    Nov 12, 2014 @ 15:01

    Yeah just update the macro to use the razor script instead of the usercontrol and that should do the trick

  • Rasmus Thyssen 14 posts 63 karma points
    Nov 13, 2014 @ 08:41
    Rasmus Thyssen
    0

    Thanks Tim.

    I think this may work.

    - For some reason the Razor file wasent "installed" in my solution, nor the macro. So i had to find the files and add the Macro with the right parameter :)

    But now i think i't works.. Thanks.

  • Comment author was deleted

    Nov 13, 2014 @ 09:58

    Great, glad it's all working now!

Please Sign in or register to post replies

Write your reply to:

Draft