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 7782577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:35:13+00:00 2026-06-01T19:35:13+00:00

Hi guys i have the following code in my view: @model Test.tblReview @{ ViewBag.Title

  • 0

Hi guys i have the following code in my view:

@model Test.tblReview

@{
    ViewBag.Title = "Create";
}

<div class = "under">
Add a New Review
</div>

<br />

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
<link href="../../Content/themes/base/jquery.ui.slider.css" rel="stylesheet" type="text/css" />

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)


        <div class="editor-label">
            @Html.HiddenFor(model => model.ReviewID)
        </div>

        <div class="editor-field">
            @Html.HiddenFor(model => model.ReviewID)
            @Html.HiddenFor(model => model.ReviewID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Recomendation)
        </div>


        <div class="editor-field">
            @Html.TextAreaFor(model => model.Recomendation, new { style = "max-width: 200px; max-height: 150px;" })
            @Html.ValidationMessageFor(model => model.Recomendation)
        </div>

    <br />


        <div class="editor-label">
            @Html.LabelFor(model => model.AvoidOrBuy)
        </div>



        <div class="editor-field">
            @Html.TextAreaFor(model => model.AvoidOrBuy, new { style = "max-width: 200px; max-height: 150px;" })
            @Html.ValidationMessageFor(model => model.AvoidOrBuy)
        </div>

        <br />

         <div class="editor-label">
          @*@Html.LabelFor(model => model.Posted)*@
        </div>

        <div class="editor-field">
            @Html.HiddenFor(m => m.Posted)
            @Html.ValidationMessageFor(model => model.Posted)
        </div>

        <br />

          <div class="editor-label">
            @Html.LabelFor(model => model.Score)
        </div>

     <br />

        <div class="demo" style="width: 185px">
        <div id="slider-range-max"></div>
        </div>

    <br />

       <p>Score Added From Scroll Bar</p>

        <div class="editor-field">
            @Html.EditorFor(model => model.Score)
            @Html.ValidationMessageFor(model => model.Score)
        </div>

     <br />
        <div class="editor-label">
            @Html.LabelFor(model => model.GameIDFK, "tblGame")
        </div>



        <div class="editor-field">
            @Html.DropDownList("GameIDFK", String.Empty)
            @Html.ValidationMessageFor(model => model.GameIDFK)
        </div>

        <div class="editor-label">
            @Html.HiddenFor(model => model.UserName)
        </div>

        <div class="editor-field">
            @Html.HiddenFor(model => model.UserName)
            @Html.HiddenFor(model => model.UserName)
        </div>

     <br />

        <p>
            <input type="submit" value="Create" />
        </p>

}

<div>
    @Html.ActionLink("Go To Reviews", "Index") |  @Html.ActionLink("Go Back To Games", "Index", "Game")
</div>

 <script type="text/javascript">
     $(function () {
         $("#slider-range-max").slider({
             range: "max",
             min: 1,
             max: 10,
             value: 1,
             slide: function (event, ui) {
                 $("#Score").val(ui.value);
             }
         });
         $("#Score").val($("#slider-range-max").slider("value"));
     });
    </script>

Everything works fine but i would like way to make the value in the drop down to clear once its been selected and the submit button is pressed, If you require addtional information please ask me thank you

  • 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-06-01T19:35:14+00:00Added an answer on June 1, 2026 at 7:35 pm

    the value in the drop down to clear once its been selected and the
    submit button is pressed

    Why do you need to do this ? I strongly believe that you should not change the value if you are going to submit it to an action method where you are going to read it for further processing. because you are not gonna get the selected value there. If you are not worried about the selected value, then you can clear that by jQuery like this

    $(function(){
     $("form").submit(function(){
       $("#GameIDFK").empty();
       return true;
     });
    });
    

    Another thing came to my mind is that , If you really want to clear the drop down, but still use in your action method, you probably need to have a hidden input element in your form and using java script, you can set the selected value of drop down to that. Then in you can clear your drop down and then in your action method, you can read from the hidden input instead of the actual drop down.

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

Sidebar

Related Questions

Hi guys I have the following code and and I want it to last
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
I have the following code. I want to get hold of the outer class
OK guys so the issue is that I have following code: HttpWebRequest req; HttpWebResponse
Guys, I have the following code that is inside a big while loop that
I am following this code to create a custom list view. It uses an
Guys i have used the following code to disable an option using jQuery (
guys i have seen following code in internet select round(abs(months_between(sysdate,add_months(hire_date,12*(round((months_between(sysdate,hire_date)/12))))))) from employees unfortunately there
I have the following code: class UserForm(ModelForm): email = forms.EmailField(widget = forms.TextInput(attrs ={ 'id':'email'}),
Hey Guys I have the following simple Code : WhereAmIViewController.h #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h>

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.