View Full Version : OnClick showing on the same page

01-05-2011, 07:25 AM

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

Philip M
01-05-2011, 08:38 AM
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.