Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6335641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:53:50+00:00 2026-05-24T18:53:50+00:00

@using (Html.BeginForm(Boxing, Company,FormMethod.Post)) { <div class=box> <div> <div class=left> <div class=topLabel> Id No:</div> <div

  • 0
@using (Html.BeginForm("Boxing", "Company",FormMethod.Post))
{ 
    <div class="box">
        <div>
            <div class="left">
                <div class="topLabel">
                    Id No:</div>
                <div class="input_text_65">
                    @Html.TextBoxFor(m => m.Id)
                </div>
                <div class="botLabel">
                    percentt:
                </div>
                <div>
                    <input type="text" style="width: 50px" name="percent" />%
                </div>
            </div>
            <div class="lastDetailField">
                <div class="topLabel">
                    D/C:
                </div>
                <div class="select_110">
                    @Html.DropDownListFor(m => m.cType, new SelectList((IEnumerable<Model.cType>)ViewData[ViewDataKeys.cTypes]), "----")
                </div>
                <div class="margin_top_45">
                    <input id="submit" type="submit" value="submit" />
                </div>
            </div>
        </div>
    </div>
}

If I didn’t select any option in the dropdownlist (leaving the optionlabel “—-” selected) and I press the submit button, the form will not be posted and the focus will be move to the dropdownlist

if I remove the optional Label, like this:

@Html.DropDownListFor(m => m.cType, new SelectList((IEnumerable)ViewData[ViewDataKeys.cTypes]))

then it will work just fine. I’m thinking if I will put an optional label, does that mean I am required to choose an item? I want the form to be submitted even if I leave the dropdownlist with the optionallabel selected.

thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:53:51+00:00Added an answer on May 24, 2026 at 6:53 pm

    Do you have a required attribute in your model/viewmoden on cType? I think the clientside validation is kicking in, but because you didn’t set a validation helper, you’re not seeing the message. The form won’t submit though if you select the optional label.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<%using (Html.BeginForm(OrderDevice, ImportXML, FormMethod.Post)) { %> <table id=OrderDevices class=data-table> <tr> <th> DeviceId </th> <th>
I have the following code: <% using (Html.BeginForm(AddComment, Comments, FormMethod.Post)) { %> <div id=New_Comment>
I have a partial view: <% using (Html.BeginForm(add, home, FormMethod.Post, new { enctype =
I've got the following View <% Using Html.BeginForm()%> <%: Html.ValidationSummary(True) %> <div class=displayright> <h3>
// html <% using (Html.BeginForm(MyAction, MyController, new { id = ViewContext.RouteData.Values[id] }, FormMethod.Post, new
Can we use it like this... <% using (Html.BeginForm(PerformSearch, ClientSearch, FormMethod.Post, new { defaultbutton
Im using mvc 2, my view is as follows <% using (Html.BeginForm(ApplyLeave, ESS, FormMethod.Post,
Currently I have a aspx page that is defined as: <%Using Html.BeginForm(SaveNotifications, Notifications, FormMethod.Post,
I have 2 forms in my myPage.chtml page as follows: @using (Html.BeginForm(Tests1, Test, FormMethod.Post,
@using (Html.BeginForm(Edit, MyController, FormMethod.Post, new { enctype=multipart/form-data})) { @Html.EditorFor(model => model.Name) <input type=file name=fileUpload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.