Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old February 27th, 2007, 11:08 PM
Newbie
 
Join Date: Feb 2007
Posts: 5
Default Creating dynamic form with ASP and user inputs

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
Reply
  #2  
Old February 28th, 2007, 08:23 AM
Newbie
 
Join Date: Feb 2007
Age: 27
Posts: 17
Default

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.
Reply
  #3  
Old February 28th, 2007, 08:21 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,374
Default

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
Reply
  #4  
Old February 28th, 2007, 08:26 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,374
Default

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
Reply
  #5  
Old February 28th, 2007, 09:43 PM
Newbie
 
Join Date: Feb 2007
Posts: 5
Default

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
Reply
  #6  
Old February 28th, 2007, 10:26 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,374
Default

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

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
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles