Copied to clipboard

Flag this post as spam?

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

  • Simon Dingley 1239 posts 2801 karma points
    Jun 08, 2017 @ 11:40
    Simon Dingley

    Hidden Div with Text Field in Default Razor View for Forms

    I am working on some fixes to help a customer become WCAG 2.0 compliant on their government site and found that by default all forms seem to include the following code:

    <div style="display: none">
        <input type="text" name="@Model.FormId.ToString().Replace("-", "")" />

    Firstly, why is this a text field in a hidden div and not a hidden field? Secondly, what is it's purpose given that forms already have the following?

    <input type="hidden" name="FormId" value="@Model.FormId" />

    I can fix the compliance issue easy enough but want to understand the implementation so I can assess the impact of the options for addressing it.

    Thanks, Simon

Please Sign in or register to post replies

Write your reply to: