When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Stump the SQL Guru!
XML Info
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
User Tips: Iterating Through the Form Contents Using JScript

By Raf Q.

Here is how to check all your form or query fields with JScript as the server-side scripting language. Note: If you replace Request.form with Request.querystring, you get all your query elements!

function showFormData(){
  laAnswers = new Array();
  lnAnswerno = 0;
  Response.write("<table border=1>");
  for(e = new Enumerator(Request.Form); !e.atEnd(); e.moveNext()){
    laAnswers[lnAnswerno] = Request.Form(e.item());
      if (laAnswers[lnAnswerno] == "")
        Response.write("<tr><td>"+lnAnswerno+"</td><td>"+e.item() +
        Response.write("<tr><td>"+lnAnswerno+"</td><td>"+e.item() +
                       "</td><td>" +laAnswers[lnAnswerno]+"</td></tr>");


To learn more about JScript, study the JScript information on Microsoft's Scripting Site and read the following 4Guys articles:

Happy Programming!

Return to user tips...

ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.