Reusable Form Validation in Golang: Step-by-Step Tutorial

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024

Комментарии • 10

  • @cdruc
    @cdruc  2 месяца назад

    At 07:28 I should have used the f.Errors.Add(field, message) method 😪Like this:
    f.Errors.Add(field, "This field cannot be empty.")
    Same for the MaxLength validation method.
    Code snippets: github.com/druc/posty

  • @pindab0ter
    @pindab0ter 2 месяца назад +2

    As a full time Laravel developer, all I can say is that I wish a framework as fully fledged and widely used as it was available in a statically typed compiled language like Go…

  • @solomonogu1393
    @solomonogu1393 2 месяца назад

    10:08 You can also maintain the state on the browser without involving the backend move all the input fields out of the form element and only keep the button inside the form element, then give the form element an id then add the attribute called form in the input which will be the id of the form element, with this you have successfully maintained state without server

    • @cdruc
      @cdruc  2 месяца назад

      no waaay!! Imma try that! thx

    • @pindab0ter
      @pindab0ter 2 месяца назад

      How and why does that work?

    • @cdruc
      @cdruc  2 месяца назад

      imma need an example cuz this doesnt seem to be working

  • @lionelagondanou7142
    @lionelagondanou7142 2 месяца назад

    Hello Sir. Thank you for your content, I really like it. Please how to prevent Ziggy from exposing routes in browser source code using inertia js and Laravel

  • @Dev-su4mi
    @Dev-su4mi 2 месяца назад +1

    can you share code with us?

    • @cdruc
      @cdruc  2 месяца назад

      logged off for today but I’ll put it on github tomorrow and update the video description🫡

    • @connormc711
      @connormc711 2 месяца назад +1

      Good idea