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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:20:35+00:00 2026-06-04T21:20:35+00:00

This is very puzzling and I am not even sure what code should I

  • 0

This is very puzzling and I am not even sure what code should I post here. Yet the problem is very simple.
I have a form in a JQuery modal dialog where I am doing some price calculations. Among others, I have a field Discount. Presented as:

<div class="editor-label">
    @Html.LabelFor(model => model.Discount)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Discount, new { size = 10 })
</div>

I see in the Firebug debugger, DOM tab, that this field has a value of 20. And it is visible on the form, of course. But calling:

 $('#Discount').val()

returns an empty string.
And this is the only field that has this problem. Calling val() for other fields returns correct values. Even clicking submit and debugging the MVC action for the model submitted, I see that the value for Discount is there. It is just the JQuery function that returns an empty string and only for this field.

I know this is a bit of an abstract question, but has anyone ever had an experience like this?

Thank you

Generated HTML:

<div class="editor-label">
  <label for="Discount">Popust (%)</label>
</div>
<div class="editor-field">
  <input id="Discount" class="text-box single-line valid" type="text" value="0" name="Discount" data-val-range-min="0" data-val-range-max="100" data-val-range="Vredonst mora biti izmedju 0 i 100" data-val-number="Polje Popust (%) mora biti broj" data-val="true" size="10">
</div>

While DOM tab in Firebug for this element shows value: “20”

  • 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-04T21:20:37+00:00Added an answer on June 4, 2026 at 9:20 pm

    Check that id ‘Discount’ is unique.

    When putting multiple forms on a single page I leave the ‘name’ alone but always prefix the id of the ‘form’ element to the id of each ‘value’.

    Saves me alot of headaches.

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

Sidebar

Related Questions

I have this very simple test code: s=helloCustomer is_contain_customer = s=='helloCustomer' || s.include? 'Customer'
This very simple code: #include <iostream> using namespace std; void exec(char* option) { cout
In this very simple code example, messages get lost every once in a while.
I have this very simple example that I am using to learn structs in
I have this very simple sql statement: SELECT max_dose FROM psychotropes WHERE (patient_meds.psychotrope =
I have this very simple button that I would like to hide <input type=button
I have this very simple XAML window: <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <ContentControl Content={Binding
This problem is really puzzling to me: I have the following script working on
this site : http://www.drbob42.com/delphi/wizards.htm showed a very puzzling code at the bottom unit ShareMem;
a noob question here. I have a very strange situation that's very puzzling to

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.