Connecting Tech Pros Worldwide Help | Site Map

Creating dynamic form with ASP and user inputs

  #1  
Old February 27th, 2007, 11:08 PM
Newbie
 
Join Date: Feb 2007
Posts: 5
I have a web form that users input answers and when submitted I want the ASP code to place the user inputs into certain locations of a HTML form. The form is then automatically opened in a new window and the user can then view, print or save the HTML document. I don't need the data to be saved or stored in a database, just placed in the HTML document. I can create the form document in HTML or PDF whatever is easier to work with.

Can anyone provide a small sample of this code, once it works I can modify as needed.

I have ASP code and a form created and can supply the code if this will help but I thought it would be to much to post.

Thanks,
JR
  #2  
Old February 28th, 2007, 08:23 AM
Newbie
 
Join Date: Feb 2007
Posts: 17

re: Creating dynamic form with ASP and user inputs


Quote:
Originally Posted by jrshack
I have a web form that users input answers and when submitted I want the ASP code to place the user inputs into certain locations of a HTML form. The form is then automatically opened in a new window and the user can then view, print or save the HTML document. I don't need the data to be saved or stored in a database, just placed in the HTML document. I can create the form document in HTML or PDF whatever is easier to work with.

Can anyone provide a small sample of this code, once it works I can modify as needed.

I have ASP code and a form created and can supply the code if this will help but I thought it would be to much to post.

Thanks,
JR
You can use Scripting.FileSystemObject and store your data in simple txt files, when you needed that you can simply use that files with asp code to retrive your data.
  #3  
Old February 28th, 2007, 08:21 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,686

re: Creating dynamic form with ASP and user inputs


If you don't need to save the text, just point the first form to an asp. For example, if you have a text area in your original form named "myText" and a select named "mySelect", the ASP to which you send the form could look like this:
Expand|Select|Wrap|Line Numbers
  1. <form>
  2. <input type="text" value="<%=request.form("myText")%>">
  3. <select>
  4. <option value="herrings"
  5. <% if request.form("mySelect") = "herrings" then response write "selected" %>
  6. >Herrings</option>
  7. <option value="anchovies"
  8. <% if request.form("mySelect") = "anchovies" then response write "selected" %>
  9. >Anchovies</option></select>
  10. </form>
  11.  
Good luck. Please let me know if this works for you.

Jared
  #4  
Old February 28th, 2007, 08:26 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,686

re: Creating dynamic form with ASP and user inputs


Or I guess you don't necessarily want the response in a form, right?
Expand|Select|Wrap|Line Numbers
  1. Value of "myText": <%=request.form("myText")%>
  2. Value of "mySelect": <%=request.form("mySelect")%>
  3.  
Jared
  #5  
Old February 28th, 2007, 09:43 PM
Newbie
 
Join Date: Feb 2007
Posts: 5

re: Creating dynamic form with ASP and user inputs


Quote:
Originally Posted by jhardman
Or I guess you don't necessarily want the response in a form, right?
Expand|Select|Wrap|Line Numbers
  1. Value of "myText": <%=request.form("myText")%>
  2. Value of "mySelect": <%=request.form("mySelect")%>
  3.  
Jared

Thanks for the reply... I want my on-line form to populate fields in a html document. When they submit the on-line form the html document opens in a new window and allows the user to view and print the document with the information supplied with the on-line form. I have code for this but its not working. The file is called "control.asp" and the form is "form.tpl" I think everthing is created I just need the line of code that calls the control.asp and where is it placed.

I can supplied the code if it will help... thanks for the reply
  #6  
Old February 28th, 2007, 10:26 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,686

re: Creating dynamic form with ASP and user inputs


it should be in the form tag:
Expand|Select|Wrap|Line Numbers
  1. <form action="control.asp" method="post">
  2.  
Jared
  #7  
Old February 28th, 2007, 11:14 PM
Newbie
 
Join Date: Feb 2007
Posts: 5

re: Creating dynamic form with ASP and user inputs


Quote:
Originally Posted by jhardman
it should be in the form tag:
Expand|Select|Wrap|Line Numbers
  1. <form action="control.asp" method="post">
  2.  
Jared
Thanks, we'll see if it works and i'll keep in touch...
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
RadioButtonList, Web User Control, Firefox, IE =?Utf-8?B?UGF1bA==?= answers 5 June 27th, 2008 09:10 PM
Is this code better than my earlier code, security wise Joey Martin answers 28 June 27th, 2008 05:34 PM
FAQ update (roundup of pending requests - for comment) Richard Cornford answers 42 July 20th, 2005 02:38 PM