Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am writing an application in Classic asp (I'm experienced in SQL Server databases, but fairly new to asp). I'm working in an iSAMS framework, a commercial product which is the front-end for managing school data (pupils, reports, etc)

My code is VBScript, and in it's simplest form, all it does is connect to a SQL Server database, loop through a table containing the fields StudentID and StudentReport (a text field showing a student report), and write to an HTML table. So, I end up with a simple display of one report per student. All good.

My question is : I am trying to find a way to be able to edit the report (this is something a teacher might have to do). I have added an edit button using Javascript, and I am looking for code to put behind it, so that the report becomes editable when the button is clicked.

I don't expect the answer to be a few lines of code - I'm not even sure if I'm approaching this in the right way. Any advice (code/web site/book) would be appreciated!

Thanks

Jim

What I have tried:

Did a fair bit of Googling for this, and I also came across this link on this site, but I am not sure if this is the best method :

https://www.codeproject.com/Articles/17318/Add-Edit-and-Delete-in-DataGridView-with-Paging
Posted
Comments
F-ES Sitecore 27-Mar-17 7:03am    
You'll struggle to find samples on Classic ASP these days, people haven't used it for over a decade. The link you posted is of no good as it's asp.net.

If you want to do this in javascript then I'd have a textbox for each row hidden so something like

<span data-studentid="<%=StudentID%>"><%=StudentReport%></span>
<input type="text" data-studentid="<%=StudentID%>" value="<%=StudentReport%>" style="display:none;">

Once you have the ID of the student you are editing use jQuery to make the span with the equivalent data-studentid hidden and the input with the equivalent data-studentid visible. Wrap it in a form and when the form is submitted you can go through the text boxes and save their values.
Jim246 27-Mar-17 13:37pm    
Thank you. I'll investigate this option.

Jim

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