• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Javascript defaultValue

March 25, 2014 by Webhead

For some reason I have never needed to use the defautlValue property up until today.  I was pleased to find javascript can access the original input value so tracking changes in a form is a bit easier.  However, the defaultValue only works as expected for “text”, “file”, and “password” fields.

http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025

A workaround is to use type=”text” and just have a style=”display:none;” to act like a hidden field.

Filed Under: Coding Tagged With: html, javascript

Primary Sidebar

Topics

502 apache apple bluehost bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git goDaddy google google analytics google maps hacked hosting htaccess html html 5 icons IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php tinymce wordpress wpengine yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools