Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Correct Arguments ONCLICK Event Handlers?

    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.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    ONCLICK = "lotteryForm.drawnNumbersTextBox.value = '' " >

    that is, two single quotes followed by double quotes.

    To make ths clearer:-

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

  • Users who have thanked Philip M for this post:

    Shanks1985 (05-17-2009)

  • #3
    New Coder
    Join Date
    May 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks for the reply, i realised i was being stupid! lol and i figured out what i was doing wrong


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •