Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Thanked 0 Times in 0 Posts

    Post OnClick showing on the same page


    I've got a question regarding javascript. I'm a total novice at this and I would love to hear any advice which could help me resolve this problem.

    I've got a html document with something like this:

    <input type="button" value="Sum up" name="A" onClick="calculate()">

    The thing is onClick="calculate()" transfers me to a new page and I need this function (calculate) shown below this button on the same page. I'm out of ideas of how should I do this.

    Thanks in advance

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,573 Times in 2,551 Posts
    I am not sure that I understand you, but why do you transfer to a different page? If you wish to pass variables to another page you must use a query string or a cookie.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.


    Posting Permissions

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