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 to the CF scene
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onClick set a variable

    I'm new to javaScript and want to create an online exam which marks the test online and emails me the result. Can I set a variable from onClick? how can I then email that variable?

    dave

  • #2
    New Coder
    Join Date
    Jan 2004
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to set a variable is simple do it in a function when the function is called in the onClick

    and for emailing it you are going to have to have some sort of emailing service set up on your server

  • #3
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    369
    Thanks
    2
    Thanked 26 Times in 26 Posts
    <form action="mailto:you@yourdain.com">
    <input type="hidden" name="thevar">
    <input type="button" value="Submit Your Score" onClick="this.form.thevar=yourvalue;this.form.submit()">
    </form>
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&


  •  

    Posting Permissions

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