Thank you both for your responses. I have found a workaround for my
problem. This really drove me crazy though the solution is not that
complicated. I’m going to be somewhat long winded so others do not
have to go through this.

I know that calling events from within html is discouraged, my story
is probably another reason not to do this.

First of all, onchange and onbur do not not work as attributes in IE6
for create elements.
For example:
var newSecurityInput = new Element('input',
{'type':'text','class':'text newid', 'name':'newid', 'onChange':
"validateNewSecurityChange(this);" ,'onBlur': "getSecurityName
(this);"});

I ended up taking a similar approach as you did for adding class
attributes, I added it after the creation of the element.

 var newSecurityInput = new Element('input', {'type':'text',
'class':'text newid', 'name':'newid'});

Event.observe(newSecurityInput,'change',validateNewSecurityChange);
Event.observe(newSecurityInput,'blur',getSecurityName);

My problem was compounded because I had inline html that already
called this function, and passed ‘this’ to it

<td class="text">
<input type="text" id="newid1" class="text" name="newid1"
onChange="validateNewSecurityChange (this);"
onBlur="getSecurityName(this);"  />

The function looked like this
          function getSecurityName (obj) {
             var securityId = $F(obj);

This had been working fine.

I created a new function for the new create element event that looks
like this.

function getSecurityName() {
             var securityId = $F(this);

This did not work as both call went to the same function.

What I had to do was create a function with a different name for the
inline html

          function getSecurityNameNoBind(obj) {
             var securityId = $F(obj);

<td class="text">
<input type="text" id="newid1" class="text" name="newid1"
onChange="validateNewSecurityChangeNoBind (this);"
onBlur="getSecurityName(this);"  />

I’m still a little confused over why I had to do this but it works.




--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to