Click to See Complete Forum and Search --> : textbox problem


chicken.king
04-01-2005, 04:18 AM
Hello
Can I know wheather the value of x can put it back to the textbox after I click the submit button ?

<html>
<head>
<title></title>
<%
function file ()
dim x
x = Request.QueryString("name")
end function
%>
<%
If Request.QueryString("submit") = "CREATE" Then
file()
End If
%>

</head>
<body >
<form action="demo-index.asp" method="get">
NAME:<input type="text" name="name" maxlength="20" /><br/>
<input type="submit" name="submit" value="CREATE" />
</form>
</body>
</html>

buntine
04-01-2005, 05:14 AM
Why can't you just print the value to the textbox? You can return the value from the function and then print it to the textbox. Its pretty messy, but will work.

<%
function file ()
dim x
x = Request.QueryString("name")
file = x '| Return the entered value.
end function

If Request.QueryString("submit") = "CREATE" Then
Dim strName
strName = file()
End If
%>
...
NAME:<input type="text" name="name" maxlength="20" value="<%= strName %>" /><br/>

Regards.

chicken.king
04-01-2005, 05:37 AM
It works
thank you very much :)

^@^

buntine
04-01-2005, 05:41 AM
Your welcome. ;)