Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have an sql table and each cell is a button. I want to make a function so when a button is clicked, the text value of the button will be displayed in a textbox somewhere else on the page.

What I have tried:

I have tried using a javascript function but it only copies the text from the first button. Is there another way to do it, maybe with ajax or jquery.
Posted
Comments
Richard Deeming 31-Oct-22 5:18am    
Almost certainly. But since you haven't shown us any of the code you're using, we can't tell you how to fix it.

At a guess, are you using the same ID for all of the buttons? Element IDs in an HTML document need to be unique.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900