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!

<Input> 2

Status
Not open for further replies.

scohan

Programmer
Dec 29, 2000
283
US
I'm using an <Input> of type image and calling an onlick funtion that validates data. Many <Input> tags call this validate function. Is there a way I can get the name of the <Input> tag that called the function? Thanks.
 
I believe you can send it the 'this' operator to get the name, and do it like:

validationFunction(this)

function validationFunction(this){
var theName = this.name;
}

should fix you up.

:)
Paul Prewett
 
...or with VBScript, like this:

validationFunction(me)

Sub validationFunction(ByRef objElement)

Dim theName

theName = objElement.ID

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top