Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple onmouseout event....I hope!

Status
Not open for further replies.

ob1kanobee

Programmer
Dec 27, 2002
47
US
I have an Add button that creates textboxes within a loop and declaring an onchange event call on the fly, but when I execute the code by clicking the Add button, it automatically goes to the validateAddress function which is supposed to validate an email address.
What am I doing wrong to cause it to fire off the validateAddress function when it builds the textbox instead of after I key in a value?

Any help will be appreciated. Thanks

var td5 = document.createElement("TD");
var inp5 = document.createElement("INPUT");
inp5.type='text';
inp5.name='sEmailAddress-'+ index;
inp5.value='';
inp5.onchange=validateAddress(inp5.value);
td5.appendChild(inp5);
td5.align='center';
inp5.width='100';
 
Maybe i'm wrong, but you should ask that on the Javascript forum, this is Java forum.

Cheers,

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top