Creating dynamic form with ASP and user inputs 
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
| 
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.
| 
February 28th, 2007, 08:21 PM
|  | 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: -
<form>
-
<input type="text" value="<%=request.form("myText")%>">
-
<select>
-
<option value="herrings"
-
<% if request.form("mySelect") = "herrings" then response write "selected" %>
-
>Herrings</option>
-
<option value="anchovies"
-
<% if request.form("mySelect") = "anchovies" then response write "selected" %>
-
>Anchovies</option></select>
-
</form>
-
Good luck. Please let me know if this works for you.
Jared
| 
February 28th, 2007, 08:26 PM
|  | 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? -
Value of "myText": <%=request.form("myText")%>
-
Value of "mySelect": <%=request.form("mySelect")%>
-
Jared
| 
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? -
Value of "myText": <%=request.form("myText")%>
-
Value of "mySelect": <%=request.form("mySelect")%>
-
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
| 
February 28th, 2007, 10:26 PM
|  | 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: -
<form action="control.asp" method="post">
-
Jared
| 
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: -
<form action="control.asp" method="post">
-
Jared | Thanks, we'll see if it works and i'll keep in touch...
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,702 network members.
|