Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get Foundation's Abide to work with Html Helper form

I updated my ASP.NET MVC project to include form validation - Abide (foundation.abide.js), but when I go to include data-abide in the form, it throws up an error. I added it to a foundation folder that is part of a script bundle which is referenced on my layout view.

@using (Html.BeginForm("CreateJourney", "Home", FormMethod.Post, new {@class = "custom", id="postJourneyForm", name="postJourneyForm", data-abide}))

Can someone explain what I am missing? Is it due to the fact that I only added the javascript file and nothing else?

like image 576
Colin Roe Avatar asked Jul 21 '13 11:07

Colin Roe


2 Answers

Using MVC4 data_abide = "" works, creating an attribute without a value.

Applying this into your code looks like:

@using (Html.BeginForm("CreateJourney", "Home", FormMethod.Post, new {@class = "custom", id="postJourneyForm", name="postJourneyForm", data_abide=""}))
like image 80
Andrew Avatar answered Nov 14 '22 23:11

Andrew


Change part of your code from

data-abide

to

data_abide
like image 2
Elvin Mammadov Avatar answered Nov 14 '22 22:11

Elvin Mammadov