Button function on table is in trouble

Whing Dela Cruz
Whing Dela Cruz used Ask the Experts™
on
Hi Experts, I attached here my project named, StockDD.asp since I'm having trouble at the time I press button to function. I have a table on this project name, myTable. During onload event a data from my database will fill in the table with a button that has a onclick function. The problem here is when I click or press the button to do its job, at the same time  the page will restart downloading again. What i need here is to make the table as is.. Is there any solution to do this?
StockDD.html
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Team Lead
Commented:
try change:

Set rs = cn.Execute("Select Proname, Price, Procode, '<button class=""Addbutton"" onclick=""myFunction()"">Show Image1</button>' as myButton from STOCK")

Open in new window

 
to:

Set rs = cn.Execute("Select Proname, Price, Procode, '<button class=""Addbutton"" onclick=""return myFunction()"">Show Image1</button>' as myButton from STOCK")

Open in new window


and change:

function myFunction() {
        alert("Active")
    }

Open in new window


to:

function myFunction() {
        alert("Active")
        return false;
    }

Open in new window

Author

Commented:
Hi Ryan, Its working. Thank you so much!

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial