Creating dynamic form with ASP and user inputs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jrshack
    New Member
    • Feb 2007
    • 5

    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
  • Akhilesh1505
    New Member
    • Feb 2007
    • 17

    #2
    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.FileS ystemObject 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.

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      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:
      Code:
      <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

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Or I guess you don't necessarily want the response in a form, right?
        Code:
        Value of "myText": <%=request.form("myText")%>
        Value of "mySelect": <%=request.form("mySelect")%>
        Jared

        Comment

        • jrshack
          New Member
          • Feb 2007
          • 5

          #5
          Originally posted by jhardman
          Or I guess you don't necessarily want the response in a form, right?
          Code:
          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.as p" 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

          Comment

          • jhardman
            Recognized Expert Specialist
            • Jan 2007
            • 3405

            #6
            it should be in the form tag:
            Code:
            <form action="control.asp" method="post">
            Jared

            Comment

            • jrshack
              New Member
              • Feb 2007
              • 5

              #7
              Originally posted by jhardman
              it should be in the form tag:
              Code:
              <form action="control.asp" method="post">
              Jared
              Thanks, we'll see if it works and i'll keep in touch...

              Comment

              Working...