Results 1 to 5 of 5

Thread: Keeping data in Input text box after submit?

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Question

    Hi,
    I have a form, code below, that contains 4 text inputs and 1 submit input. When the form is submitted the text in the inputs disappears.
    Is there a way to keep the inputted text in the boxes after submitting?
    Thanks,
    Al.

    Code:
    Sub CreateForm()
    With Response
    	.Write "<H1 align=center>Transfer Inventory</H2>"
    	.Write "<H2 align=center><a href=w2b.html>Back to Main Menu</a></H3>"
    	.Write "<FORM METHOD=POST>"
    	.Write "<BODY BGCOLOR=#C0C0C0 TEXT=#000000 VLINK=#FF00FF>"
    	.Write "<FONT FACE=Arial>"
    	.Write "<CENTER>"
    	.Write "<B>Item Code</B>  "
    	.Write "<Input Type=Text Size=20 Name=Item_Code></input>  "
    	.Write "<B>Quantity</B>  "
    	.Write "<Input Type=Text Size=5 Name=Quantity></input>  "
    	.Write "<B>From Warehouse</B>  "
    	.Write "<Input Type=Text Size=3 Name=From_Whse></Input>  "
    	.Write "<B>To Warehouse</B>  "
    	.Write "<Input Type=Text Size=3 Name=To_Whse></Input>  <BR><BR><BR>"
    	.Write "<Input Type=Submit Value=OK></Input><BR><BR>"
    End With
    
    SendData
    
    End Sub
    A computer is a tool, not a toy.

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    where is this form being submitted to?
    Secret to long life:
    Keep breathing as long as possible.

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    If the form is being submitted back to itself you could probably do:

    response.Write "<Input Type=Text Size=20 Name=Item_Code Value='" & request("Item_Code") & "'>"



    I haven't tested it though because I havn't got PWS intalled on this PC!
    Mark
    -------------------

  4. #4

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Hi,
    The form submits the data to Sub SendData() which updates a database.
    First the Sub validates the data and if there is an error it displays an error message, e.g. Invalid Item Code. If everything is OK then it changes the on hand quantity of the item in the from and to warehouses depending on the quantity transfered.
    Al.
    A computer is a tool, not a toy.

  5. #5
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    you could use javascript to refresh the fields...?
    Secret to long life:
    Keep breathing as long as possible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width