I have created a form and their are several textbox,
What i want that after click on submit button, whatever the valueis in textbox dont disappear, as I put validation over their as i Click submit again i have to put the value even though value is correct.
So, i want Whatever value i entered should be fixed not changed, and it acn only changed when validation is false.
my code is:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<BODY>
<form method="post" action="page2.asp">
<p>Firstname <INPUT name="fname"></p>
<p>LastName <INPUT name="lname"></p>
<p>Address
<INPUT name="add" ></p>
<p>Contact Number <INPUT name="contactnum"></p>
<p>Date Of Birth <INPUT name="dob"
style="margin-left: 10px" ></p>
<p><INPUT name="submit" value="submit" type=submit></p></FORM>
</BODY>
</HTML>
<%
Dim textfname,textlname,add,contact,dob,msg,count
msg=""
count=0
Function RefererIs(pagename)
IF Right(Request.ServerVariables("HTTP_REFERER"),len(pagename)) = pagename Then
RefererIs = True
Else
RefererIs = false
End IF
Select case RefererIs
case false
select case instr(lcase(request.servervariables("HTTP_REFERER")),Lcase(pagename))
case 0
case else
RefererIs =True
End Select
Case Else
End Select
End Function
IF RefererIs("page2.asp") Then
textfname= Request("fname")
textlname=Request("lname")
add=Request("add")
contact=Request("contactnum")
dob=Request("dob")
IF Request("submit")="submit" THEN
IF Trim(textfname)="" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Please Enter Your First Name</font>"
count=count+1
End If
IF Trim(textlname)="" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Please Enter Your Last Name</font>"
count=count+1
End If
IF Trim(add)="" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Please Enter Your Address</font>"
count=count+1
End If
IF Trim(contact)="" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Please Enter Your Contact Number</font>"
count=count+1
Else
IF IsNumeric(contact)="False" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Contact Should be Numeric</font>"
count=count+1
End If
End If
IF Trim(dob)="" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Please Enter Your Date of Birth</font>"
count=count+1
Else
IF IsDate(dob)="False" THEN
msg=msg+"<br><font size="" 2="" face="" verdana="" color="" red="">Please Enter Your Date of Birth In Correct Format</font>"
count=count+1
End If
End If
IF count>0 THEN
Response.Write(msg)
ELSE
Response.Redirect("page1.asp?fname="& textfname & "&lname="& textlname & "&add="& add & "&contactnum="& contact & "&dob="& dob)
END IF
END IF
END IF
%></br></br></br></br></br></br></br>
[edit]"Ignore HTML..." option disabled - OriginalGriff[/edit]