javascript - Do I need to use "document.getElementById" -


i still haven't got code work correctly in ie9. works ok in firefox though. have use "document.getelementbyid" work in ie9? if so, fit in?

function dbasetype(){  var dbasedata = document.forms[0]._dbase_name.value;         dbasedata = dbasedata.touppercase();         dbasedata = dbasedata.replace(/\s/g, "");  var _area = document.forms[0]._area;         var _dbase_name = document.forms[0]._dbase_name;  if  (dbasedata.indexof("uk_contacts")==-1) {         _area.value = _dbase_name.value;                  }  else { setarea(); }       } 

edit above code updates field (that controls access individuals) in database when save button clicked. works ok in firefox said when runs in ie9 field supposed updated , replaced blank , user loses access contact record.

your problem ie has stupid property every id global (readonly) object. have rename variable in javascript this:

function dbasetype() {   var dbasedata = document.forms[0]._dbase_name.value;   dbasedata = dbasedata.touppercase().replace(/\s/g, "");    var x_area = document.forms[0]._area;           var x_dbase_name = document.forms[0]._dbase_name;    if(dbasedata.indexof("uk_contacts")==-1) {     x_area.value = x_dbase_name.value;               } else {     setarea();   }  } 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -