View Full Version : Correct Arguments ONCLICK Event Handlers?

05-07-2009, 09:19 PM
So....Try and lay it down. Im trying to write a code to draw random numbers, like a lottery generator. It will require the user to input amount of numbers per line & choose the amount of numbers. From the numbers the user inputs it will generate random numbers to that guideline.

I have wrote the random number function, that works fine. Im having problems invoking it with ONCLICK event handlers. I cant seem to get the correct arguments. And all i get in return is "undefined"

This is the form for the onclick button
<INPUT TYPE = "button" NAME = "drawBalls" VALUE ="Draw the Balls!"
ONCLICK = "lotteryForm.drawnNumbersTextBox.value = ">

Now Im not putting up to much code, as its part of an Assignment, I dont want to cheat, i just want to be pointed in the right direction. :(

Philip M
05-07-2009, 10:03 PM
ONCLICK = "lotteryForm.drawnNumbersTextBox.value = '' " >

that is, two single quotes followed by double quotes.

To make ths clearer:-

ONCLICK = "lotteryForm.drawnNumbersTextBox.value = 'XYZ' " >

05-09-2009, 11:58 AM
Thanks for the reply, i realised i was being stupid! lol and i figured out what i was doing wrong:thumbsup: