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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:32:09+00:00 2026-05-15T02:32:09+00:00

Case is I want to prompt a message (Do you want to save changes?)

  • 0

Case is I want to prompt a message (Do you want to save changes?) if multiline text box default value is updated on .aspx page before submitting the page. I am using .text() to compare with .val().
It works fine in firefox. .text() shows the default value in firefox but in IE7 and 8 .text() shows updated value (like .val()).

if ($("#<%=txt1.ClientID%>").attr("value") === $("#<%=txt1.ClientID%>").text())
    return(true);
return confirm('Do you wish to save these changes?');
  • 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-15T02:32:10+00:00Added an answer on May 15, 2026 at 2:32 am

    jQuery doesn’t give you any special function to access the defaultValue property, so you’d have to use the DOM property directly:

    var field= $('#<%=txt1.ClientID%>').get(0);
    if (field.value!==field.defaultValue)
         return confirm('Do you wish to save these changes?');
    

    (Works for normal text <input> as well as <textarea>.)

    However note that the defaultValue is the initial value of the field in the HTML source. If the page loaded with different content in the field, typically because you have gone to the next page and then hit ‘Back’, the defaultValue will still be the original value and so if you click again you’ll get the changed-warning again even though you haven’t touched it since going ‘Back’.

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

Sidebar

Related Questions

The use case I want to achive is. 1. Fetch XML from a remote
I Have two problem in this Case : I want to pass a JSON
What logging library or approach would you recommend for this case: We want to
In the case when I want to check, if a certain entry in the
I have a case where i want to submit a form and get the
I have the following case where I want to accept the following routs '/type/view/23'
I have a quite specific client-server design case and I want to ask for
I want to use a case statement in my user-defined functions because I need
I want to check whether a Tag (Case-Sensitive) exists in SQL Server 2005 table
I want to use a case statement where my logic determines a date. If

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.