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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:25:27+00:00 2026-06-15T22:25:27+00:00

I have a popup dialog in my page which has like 20 fields. The

  • 0

I have a popup dialog in my page which has like 20 fields. The 20 fields can be modified and any change to the dialog will be updated to the server.

Only in IE8, the field values are set to null when the user tries to clear the fields and save the content.

It seems like Serializing the value of empty DOM elements using IE8’s native JSON.stringfy function was returning "null" (string) instead of ""

DEMO: http://jsfiddle.net/6VKzy/2/ [Open in IE8]

More details about the issue from blog,

With native JSON support enabled in IE8, users can now take advantage
of the built-in JSON.stringify and JSON.parse methods to serialize and
deserialize JScript values to JSON text and vice versa. However, there
is a known issue in IE8’s native JSON implementation, wherein if a
user tries to read the value of an empty DOM element, and serialize
the same using native JSON, the result is not the same as a user would
expect while serializing “”
.

http://blogs.msdn.com/b/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx

Note: This question is self answered.

  • 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-15T22:25:28+00:00Added an answer on June 15, 2026 at 10:25 pm

    The fix is to use the censor function like below to return "" instead of "null".

    function(k, v) { return v === "" ? "" : v }
    

    Fixed DEMO: http://jsfiddle.net/6VKzy/3/ [Open in IE8 to verify the fix]

    More details and different approaches to the fix in the blog,

    This is a bug in the production version of IE8. The problem here is
    that within the DOM a special encoding is used to represent a missing
    string value. Even though this special value is different from the
    encoding of the JScript literal “”, throughout the JScript
    implementation the value is treated as being === to “”, except for a
    specific case in JSON.stringify.

    Since this special value only originates from accesses to DOM objects,
    a workaround would be to explicitly censor them on every DOM access
    that might return one.

    http://blogs.msdn.com/b/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx

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

Sidebar

Related Questions

I have a Delphi 2006 app which can pop up a modal dialog in
I have a Page which has a Control on it with 2 textboxes (username
I have an asp.net usercontrol which represents a popup dialog. Basically, it's a wrapper
I have a web page which loads in two different ways; user can click
I want it to have a popup dialog javascript box. Instead of a new
I have a dialog popup to indicate how long I want an activity to
I have a JInternalFrame window that needs to popup a modal dialog box when
I have a dialog - <div data-role=dialog id=msg-popup> <div data-role=header> <h1>Notification</h1> </div> <div data-role=content
I have a jquery dialog as follows - <div data-role=dialog id=msg-popup> <div data-role=header> <h1>Notification</h1>
I need to have a pop-up dialog like the Color Dialog or Save Dialog

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.