Skip to content
Advertisement

SQL data displayed from a table to a textbox

I currently have a search screen to display results. A user can click on a link in that search screen to open a new window and view additional information. Currently i’m able to display the additional information as a table however I want to display the data in text boxes.

Currently my code to display the data ins a table is as follows: Code to get the id of the row that the user has clicked on

JavaScript

Code to display the data as a table:

JavaScript

I want to display the data in text boxes and its not as easy as I thought. I thought I could just changethe row to a text box as below.

JavaScript

Any pointers would be greatly appreciated.

Advertisement

Answer

As another has said you are open to abuse here but because anyone can type anything into the address bar as a get variable. Try this instead.

JavaScript

Conclusions: if there is no GET data or if the GET data doesn’t correspond to anything in your table nothing will happen.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement