B
bart plessers
Hello,
I have a form with some checkboxes, i.e.
The default value of this checkbox is determined in a global file
(config.asp), that is included in first line of the form, i.e.
ShowFilenames = 1
The first time the form is displayed, the value of ShowFilenames should be
the one defined in config.asp.
As result of the form, the value should be modified according to users input
I achieved this by checking the contents :
ShowFilenames = Len(Request.Form("ShowFilenames"))>0
However,
The first time the form is showed, no data is passed yet to the form,
so Request.Form("ShowFilenames") is empty
and ShowFilenames becomes False
How can I make that in this case ShowFileNames becomes the value defined in
the included file?
The whole section of Request.Form should only be executed IF the form has
already been executed.
So Is there a way to determine this?
tia
bartp
As an example, here is my form
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<!--#include file="_settings.asp" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
If Len(Request.Form("Rows"))>0 Then Rows = CInt(Request.Form("Rows")) end if
If Len(Request.Form("Columns"))>0 Then Columns =
CInt(Request.Form("Columns")) end if
ShowFilenames = Len(Request.Form("ShowFilenames"))>0
%>
<body>
<p>FORM</p>
<FORM NAME="frmFileViewer" ACTION="" METHOD="post">
<TABLE border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCCC">
<tr>
<td width="100">Columns</td>
<td><input type='text' name='Columns' value='<%=Columns%>'
size='4'></td>
</tr>
<tr>
<td>Rows</td>
<td> <input type='text' name='Rows' value='<%=Rows%>' size='4'></td>
<tr>
<td>ShowFileName</td>
<td> <input type="checkbox" name="ShowFilenames" value="1" <%if
ShowFilenames Then %>checked<%end if%>></td>
<tr>
<td> </td>
<td><input type="submit" value="Submit" name="ButtonSubmit"></td>
</tr>
</TABLE>
</FORM>
<p>FORM RESULTS</p>
<TABLE border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCCC">
<tr>
<td width="100">Columns</td>
<td><%=Columns%></td>
</tr>
<tr>
<td>Rows</td>
<td>
<%=Rows%>
</td>
<tr>
<td>ShowFileNames</td>
<td>
<%=ShowFileNames%>
</td>
<tr>
<td> </td>
<td> </td>
</tr>
</TABLE>
<p> </p>
</body>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
and the included file
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%
Columns=3
Rows = 2
ShowFileName = True
%>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
==========================================
Hyper A.R.T.
bart plessers
Paul Van Ostaijenlaan 4
3001 Heverlee
BELGIUM
tel: +32 (16) 23.40.85
fax: +32 (16) 23.41.06
==========================================
I have a form with some checkboxes, i.e.
The default value of this checkbox is determined in a global file
(config.asp), that is included in first line of the form, i.e.
ShowFilenames = 1
The first time the form is displayed, the value of ShowFilenames should be
the one defined in config.asp.
As result of the form, the value should be modified according to users input
I achieved this by checking the contents :
ShowFilenames = Len(Request.Form("ShowFilenames"))>0
However,
The first time the form is showed, no data is passed yet to the form,
so Request.Form("ShowFilenames") is empty
and ShowFilenames becomes False
How can I make that in this case ShowFileNames becomes the value defined in
the included file?
The whole section of Request.Form should only be executed IF the form has
already been executed.
So Is there a way to determine this?
tia
bartp
As an example, here is my form
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<!--#include file="_settings.asp" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
If Len(Request.Form("Rows"))>0 Then Rows = CInt(Request.Form("Rows")) end if
If Len(Request.Form("Columns"))>0 Then Columns =
CInt(Request.Form("Columns")) end if
ShowFilenames = Len(Request.Form("ShowFilenames"))>0
%>
<body>
<p>FORM</p>
<FORM NAME="frmFileViewer" ACTION="" METHOD="post">
<TABLE border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCCC">
<tr>
<td width="100">Columns</td>
<td><input type='text' name='Columns' value='<%=Columns%>'
size='4'></td>
</tr>
<tr>
<td>Rows</td>
<td> <input type='text' name='Rows' value='<%=Rows%>' size='4'></td>
<tr>
<td>ShowFileName</td>
<td> <input type="checkbox" name="ShowFilenames" value="1" <%if
ShowFilenames Then %>checked<%end if%>></td>
<tr>
<td> </td>
<td><input type="submit" value="Submit" name="ButtonSubmit"></td>
</tr>
</TABLE>
</FORM>
<p>FORM RESULTS</p>
<TABLE border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCCC">
<tr>
<td width="100">Columns</td>
<td><%=Columns%></td>
</tr>
<tr>
<td>Rows</td>
<td>
<%=Rows%>
</td>
<tr>
<td>ShowFileNames</td>
<td>
<%=ShowFileNames%>
</td>
<tr>
<td> </td>
<td> </td>
</tr>
</TABLE>
<p> </p>
</body>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
and the included file
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%
Columns=3
Rows = 2
ShowFileName = True
%>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
==========================================
Hyper A.R.T.
bart plessers
Paul Van Ostaijenlaan 4
3001 Heverlee
BELGIUM
tel: +32 (16) 23.40.85
fax: +32 (16) 23.41.06
==========================================