2
@using (Html.BeginForm("", "actionname", FormMethod.Post, new { id = "card-activate-form" , data_parsley_validate="true" }))

will render

<form action="actionname" data-parsley-validate="true" id="card-activate-form" method="post">

but ideally it should be 'data-parsley-validate' only

<form action="actionname" data-parsley-validate id="card-activate-form" method="post">

how to add data-parsley-validate only in the form

0

1 Answer 1

3

You can implement it with string.Empty or "" like following

@using (Html.BeginForm("", "actionname", FormMethod.Post, new { id = "card-activate-form" , data_parsley_validate="" })) @*//or string.Empty*@

it will produce

<form action="actionname" data-parsley-validate id="card-activate-form" method="post">
Sign up to request clarification or add additional context in comments.

2 Comments

thanks a lot. tested and working. thanks again for the help
@Kruze You are welcome:) if it worked for you, please consider to accept the answer to help people understand problem has been solved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.