Copied to clipboard

Flag this post as spam?

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


  • George Logan 36 posts 168 karma points
    Sep 27, 2018 @ 10:40
    George Logan
    0

    Finding Form files in Visual Studio

    Hello,

    Apologies, there are 2 parts to this question.

    First I'm looking to do some validation around Email and Confirm Email fields....

    I found this article - https://our.umbraco.com/forum/umbraco-pro/contour/40594-How-do-I-validate-with-a-confirm-email-field

    Is this still relevant?

    Secondly, the code behind the forms....where can I locate this in Visual Studio? As I can't seem to find at all.

    Thanks,

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Sep 27, 2018 @ 16:21
    Jan Skovgaard
    0

    Hi George and welcome to the Umbraco forum :)

    I'm not sure how to interpret your question about where to find the code behind the forms - Is it where you find the views (With the HTML) or is it the source code for the forms product?

    If you need to figure out where to modify the views etc. then I'll recommend that you take a look at the documentation for forms here: https://our.umbraco.com/Documentation/Add-ons/UmbracoForms/Developer/ - Here you should be able to find information about how to customize forms using themes, validation etc.

    The post you reference above is outdated by now I'd say so the advice given might not be relevant anymore.

    I hope this helps :)

    /Jan

  • George Logan 36 posts 168 karma points
    Sep 28, 2018 @ 09:00
    George Logan
    0

    Hi Jan,

    Thanks very much for your response.

    Yeah, sorry, to be more clear - the views(with HTML) for the forms.

    For example, in backoffice I create a form called 'Contact Form' complete with fields and workflow.

    Where do I find the view for the 'Contact Form' ?

    I had a look at the link you provided (thank you for that, very informative) but I still can't find any views for my forms?

    I have been in my current role 5 weeks and have inherited the Umbraco site we use.

    Is there something in the setup/config that is missing?

    Thanks again for your help.

    George

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Sep 28, 2018 @ 11:03
    Jan Skovgaard
    0

    Hi George

    Hmm what exact version of forms are you using? It might be an earlier version for which the current documentation may no longer hold true.

    What version of Umbraco are you using? The forms version should be visible somewhere on the form section dashboard - Not in front of an installation where I can see where it should be placed so not able to guide you in a better direction right now.

    /Jan

  • George Logan 36 posts 168 karma points
    Sep 28, 2018 @ 11:05
    George Logan
    0

    Hi Jan,

    Umbraco version 7.5.3

    Forms version 4.4.6

    Thanks,

    George

  • George Logan 36 posts 168 karma points
    Sep 28, 2018 @ 11:06
    George Logan
    0

    Hi Jan,

    Umbraco version - 7.5.3

    Umbraco Forms - 4.4.6

    Thanks,

    George

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Sep 28, 2018 @ 11:12
    Jan Skovgaard
    100

    Hi George

    Ok, then the documentation should be useful :)

    I missed the reply from James below before I replied - And he is right that you should have a look in the form.cshtml file.

    Forms are being generated generically depending on how you have setup the form etc.

    But are you asking because you need to tweak the styling or enable validation or what is the thing you need to change? :)

    Customizing is described here where form.cshtml is also mentioned https://our.umbraco.com/Documentation/Add-ons/UmbracoForms/Developer/Custom-Markup/

    If it's because you need to control where form scripts are being rendered then you should be able to find the information here https://our.umbraco.com/Documentation/Add-ons/UmbracoForms/Developer/Rendering-Scripts/

    I hope this helps - But otherwise please elaborate a bit more on what it is you need to change :)

    Cheers,

    Jan

  • George Logan 36 posts 168 karma points
    Sep 28, 2018 @ 11:20
    George Logan
    0

    Hi Jan,

    Thanks again for your support with this.

    Ok...so I have numerous forms (about 46) in total.

    On 1 I have just been asked to create, the user has requested an 'Email' field and a 'Confirm Email' field - out of the box there is nothing to tie these fields together, or indeed validate that they match ?

    I thought the form itself would have its own view to add validation code to.

    If I add validation code to forms.cshtml via James' link, will this not interfere with all forms?

    Apologies if I have mis-understood.

    Thanks,

    George

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Sep 30, 2018 @ 18:53
    Jan Skovgaard
    0

    Hi George

    Ah ok I see - Hmm, I must admit that I have not had the chance to play with the theming feature yet so I don't know if there is a really smart way to achieve this,

    But one way around it could perhaps be to reference the id of the specific form and then find the fields to compare that way? If I remember correctly each form get a unique id...But I do also realise this way of doing it might not be very robust.

    I'll let you know if I can think of other things to try out.

    /Jan

  • James Meredith 18 posts 91 karma points
    Sep 28, 2018 @ 10:42
    James Meredith
    1

    Hi George,

    If you have created the form via the Umbraco Forms section in the backend I believe the forms are generated using the partial ~/Views/Partials/Forms/Form.cshtml. This view is used the generate every form though not just specifically the 'Contact Form' you created in the back end.

    Hope this helps

    James

  • George Logan 36 posts 168 karma points
    Sep 28, 2018 @ 10:48
    George Logan
    0

    Hi James,

    Thanks for your response.

    So is there no way to access views for forms created by Umbraco forms then?

    Only if you create a custom form from scratch?

    Thanks,

    George

  • James Meredith 18 posts 91 karma points
    Sep 28, 2018 @ 12:14
    James Meredith
    0

    I guess it depends on what exactly you're trying to do. Your not going to get a view for a form on umbraco forms that has each individual fields on it if that's what you mean. However you need some specific action to occur during the form generation of the contact form you can utilise Themes (https://our.umbraco.com/documentation/Add-ons/UmbracoForms/Developer/Themes/) and assign a theme for the contact effectively giving you a view specifically for the contact form.

    If you need a truely custom view for dealing with more complex issues I would look into using a surface controller instead.

    James

  • George Logan 36 posts 168 karma points
    Oct 02, 2018 @ 09:34
    George Logan
    1

    Thank you both Jan and James,

    I've been working on something different the last couple of days, so not had a chance to investigate further. Should hopefully have some time later today to dig a bit further.

    I will let you know of any progress I make.

    Thanks again!

    George

  • George Logan 36 posts 168 karma points
    Nov 14, 2018 @ 12:11
    George Logan
    0

    Hi Guys,

    Sorry, I can't mark both as answer.

    I did follow Jan's route of Custom Markup - https://our.umbraco.com/Documentation/Add-ons/UmbracoForms/Developer/Custom-Markup/

    But do appreciate there is an alternative which James provided.

    Thanks again both for the support.

Please Sign in or register to post replies

Write your reply to:

Draft