Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

asked on 

Making Table Thru ASP Response.write

Hi experts, I wish to put an id of the table below but when i tried to insert id="myTable" it didn't work. And also the result of the code as the client received this, (the server), it shows no table except the data. Any help please.

      If not .BOF = True And not .EOF = True Then 'found record
         response.write("<table>")
         do until rs.EOF
            response.write("<tr><td>" & Response.Write(rs("Procode")) & "</td>")
            response.write("<tr><td>" & Response.Write(rs("Proname")) & "</td></tr>")
            rs.MoveNext
         loop
         response.write("</table>")
      else
         response.write("No record!")
      End If

Open in new window

ASPHTMLJavaScript

Avatar of undefined
Last Comment
Whing Dela Cruz
Avatar of Whing Dela Cruz
Whing Dela Cruz
Flag of Anguilla image

ASKER

HI experts, The code below is working. The problem now is how to put id on table and put event on the button. Any help please!

      If not .BOF = True And not .EOF = True Then 'found record
      response.write("<table>")
            do until rs.EOF
                response.write("<tr>")
                response.write("<td>" & "<button>Add item</button>" & "</td>")
                response.write("<td>" & rs("Procode") & "</td>")
                response.write("<td>" & rs("Proname") & "</td>")
                response.write("<td>" & rs("UnitCost") & "</td>")
              rs.MoveNext
            loop
      response.write("</tr>")
      response.write("</table>")
      else
         response.write("No record!")
      End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Whing Dela Cruz

ASKER

Hi Julian, its working. Thank you so much!
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

You are welcome.

Remember quotes in strings in ASP require a double quote to escape them. If this happens at the end of the string you will have 3 quotes together.
Avatar of Whing Dela Cruz

ASKER

Noted sir, and thanks a lot!
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo