User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 423,955 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,179 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 2176 | Replies: 2
Reply
Join Date: Dec 2004
Location: India
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Fetching Form Values with ASP

  #1  
Mar 15th, 2007
Hey!

I came up with the new problem. I want to fetch all form values by using request.form("FormName") which is generated by javascript on runtime.

The attached zip code contains the working code of javascript creating dynamic form elements. So after generating a couple of textboxes when I click on the "Submit" button it should display all the values entered in the textboxes on the next page.

Herez a working example of that javascript: http://www.quirksmode.org/dom/domform.html

Is this Possible?


Thanx
Attached Files
File Type: zip RuntimeFormElements.zip (6.3 KB, 2 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: Michigan
Posts: 2
Reputation: DataGrl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
DataGrl's Avatar
DataGrl DataGrl is offline Offline
Newbie Poster

Re: Fetching Form Values with ASP

  #2  
May 11th, 2007
If you are saying you would rather return the results to an asp page than use the CGI, you can comment out the:
<!--<form method="post" action="/cgi-in/show_params.cgi">-->

towards the end of index.html and insert
 <form method="post" action="myNewAspPageName.asp">
Immediately after this line:
<div id="readroot" style="display: none">

Your form will now submit to your new asp page instead of to the CGI.

The next trick is reading the form items when you do not know how many are going to be sent.

Your asp page can determine this for you with:
'--returns all fields (names and values) submitted by the form
strFormInfo = Request.Form
response.write strFormInfo & "<BR>"
Which will return an ampersand (&) delimitted string that looks something like this:
rankingsel=Rating&rankingsew=Rating&cd=title&rankingsel2=Rating&rankingsew2=Rating&cd2=title

From here, you can parse the string as you see fit.

Disclaimer: I do not know the limits of "Request.Form" and how it may be affected by the user's ability to eternally add fields.
Delete * Where FlatFile=True
Reply With Quote  
Join Date: May 2007
Location: India
Posts: 6
Reputation: MohitB is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
MohitB's Avatar
MohitB MohitB is offline Offline
Newbie Poster

Solution Re: Fetching Form Values with ASP

  #3  
May 23rd, 2007
Hi,
You can use this code
<%
dim i
For Each i in request.form("FormName")
Response.Write(i & "<br />")
Next
%>
where using i variable u can find the name of cantrol and its value.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 6:22 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC