PDA

Click to See Complete Forum and Search --> : Keeping data in Input text box after submit?


Al Smith
Jul 12th, 2000, 01:51 PM
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.


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

dvst8
Jul 12th, 2000, 01:57 PM
where is this form being submitted to?

Mark Sreeves
Jul 12th, 2000, 02:09 PM
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! :(

Al Smith
Jul 12th, 2000, 02:20 PM
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.

dvst8
Jul 12th, 2000, 02:23 PM
you could use javascript to refresh the fields...?