So, I have a simple bit of code that asks a user to confirm that they
want to change the existing value of a text field:

<code>
...
Event.observe(this._form['txtFld'], 'change',
this.txtFldChanged.bindAsEventListener(this), false);
this._txtFld = this._form['txtFld'].value;
...
function txtFldChanged(e)
{
  var confirmed = (this._txtFld == '');

  if (! confirmed)
  {
    confirmed = confirm('Are you sure you want to change the value of
txtFld?');
  }

  if (! confirmed)
  {
    this._form['txtFld'].value = this._txtFld;
    Event.element(e).focus();
  }

  return confirmed;
}
</code>

In FF, this works fine, every time you edit the content of the field.
In IE, it works once - after that the change event does not fire. I've
seen some mention of a possible behavior issue in IE having to do with
modification of the text field value programmatically within the event
bubble for the field's change event, but nothing concrete.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to