Hi,
This question is rather involved, so here goes ...
I am using objects in javascript to create and display input textboxes. Along with the textbox is a button that allows the user to check whether his/her input was correct. Essentially this is automating the code normally associated putting an input box and send button on the screen, so the only code needed is
The problem comes when I want to use the onClick event to check the input. Since the Label object has a "check" function, I would like to write onKlick="this.check();" However, once the label is written into the body of the document, the keyword 'this' is not recognized. Instead I need the name of the object. So far the only way I have figured out to do this is to make the object's name into a field (i.e., var lbl = new Label(3, idLabel, 'lbl')
which is ugly and dangerous.
Is there a way to get the name of the object (not the class), or another better way to approach the problem? Thanks! Karen.
(onClick misspelled below to get around javaranch security)