I have same question. I think need to put into @Html.EditorFor(model => model.Email) some default value and hide this label. But I don't know how to do this(
<div class="inputs" style="display: none;"> @Html.LabelFor(model => model.Email, new { }, ":") @Html.TextBoxFor(model => model.Email, new { Value = T("[email protected]") }) @Html.RequiredHint() @Html.ValidationMessageFor(model => model.Email) </div>
That's it! Yes new model and validating is better, but this way is faster) But in my case I need to remove email from everywhere, not only from shipping Address
<div class="inputs" style="display: none;"> @Html.LabelFor(model => model.Email, new { }, ":") @Html.TextBoxFor(model => model.Email, new { Value = T("[email protected]") }) @Html.RequiredHint() @Html.ValidationMessageFor(model => model.Email) </div>
Where do you make this change (for those programmers less apt as myself)? Please spell it out in simple steps. This method will not remove the email field from the billing address right? I need to have their email address, I just don't want them to have to put it in twice if they have a different billing and shipping address. Thanks in advance.
<div class="inputs" style="display: none;"> @Html.LabelFor(model => model.Email, new { }, ":") @Html.TextBoxFor(model => model.Email, new { Value = T("[email protected]") }) @Html.RequiredHint() @Html.ValidationMessageFor(model => model.Email) </div>
That's it! Yes new model and validating is better, but this way is faster) But in my case I need to remove email from everywhere, not only from shipping Address
I know this is an old thread, but I have a situation where we are processing many orders that are phoned in, and the customers are unwilling to provide their email address. Rather than be required to input a bogus email address for those phone orders, I'd like my employees to be able to skip that field altogether.
I'd like to be able to do something like you have done, (using CSS to hide the field) but only when the current user is in Admin role.
What I'm wondering is this....is the "isAdmin" variable exposed during registration/checkout? Or is there a variable that indicates the ACL role of the visitor which I could check for during registration/checkout?
Even better would be the ability to just remove the "required" validation based on customer role..possible?