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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:10:55+00:00 2026-06-10T03:10:55+00:00

We have code in our website that does a comparsion to what was stored

  • 0

We have code in our website that does a comparsion to what was stored in the database with what the user types in the textbox. This functionality works as is. But, I wanted to add some code to to set a empty string value that shows up in the “lbl_hiredate_change” and set it equal to the string “blank”. I added the if statement with the comment “//my addition” in the below code. Can someone suggest something that will work (this doesn’t). I only want to convert the “” to “blank” at runtime, and don’t want that saved in the database.

Thanks,
Brad.

ASP.Net Code:

<div>    
    <asp:TextBox  ID="tb_hiredate" CssClass="showOriginal required date" 
     title="Please enter the date this person was hired" runat="server"></asp:TextBox>
    <asp:Panel ID="show_hiredate_changed" CssClass="showOriginalLine" runat="server">
      (was: <asp:Label ID="lbl_hiredate_changed" CssClass="showOriginalValue was-label" runat="server"></asp:Label>)
    </asp:Panel>
</div>

Javascript:

$(document).ready(function () {
    $('input.showOriginal').change(function (e) {
        showOriginal($(this));
    });
});

function showOriginal(theControl) {
var thePanel = theControl.siblings('.showOriginalLine');
var theWasLabel = thePanel.find('.showOriginalValue');
if (theControl.val() == theWasLabel.html()) {
    thePanel.css('display', 'none');
}
else {
    //my addition.
    if ($('.was-label').val() == '') {
        $(this).val('blank');
    }
    thePanel.css('display', 'block');
}

}

  • 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-10T03:10:56+00:00Added an answer on June 10, 2026 at 3:10 am

    Use text() instead of val() Read more about val(), text(), html()

     if (theWasLabel.text() == '') 
     { 
       theWasLabel.text('blank');
     } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have enabled google Minify in code igniter using this library on our website.
Our website code is written in PHP. We have very little testing in regards
We have a medium sized ColdFusion code base for our Intranet and Website. For
In our code we have quite a few cases of this pattern: class outerClass
In many places in our application we have code like this: using(RAPI rapi =
We have this anonymous function in our code, which is part of the jQuery's
Currently, when we update our PHP code for our website, we have a script
We have our own web server hosting our website that is open to the
Around 90% of the pages for our websites have no .Net code embedded in
In our code I have the following, for now please ignore the //* bits;

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.