473,842 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to determine is a FORM has displayed for first time?

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.For m("ShowFilename s"))>0

However,
The first time the form is showed, no data is passed yet to the form,
so Request.Form("S howFilenames") 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>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
If Len(Request.For m("Rows"))>0 Then Rows = CInt(Request.Fo rm("Rows")) end if
If Len(Request.For m("Columns")) >0 Then Columns =
CInt(Request.Fo rm("Columns")) end if
ShowFilenames = Len(Request.For m("ShowFilename s"))>0
%>

<body>
<p>FORM</p>
<FORM NAME="frmFileVi ewer" ACTION="" METHOD="post">
<TABLE border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCC C">
<tr>
<td width="100">Col umns</td>
<td><input type='text' name='Columns' value='<%=Colum ns%>'
size='4'></td>
</tr>
<tr>
<td>Rows</td>
<td> <input type='text' name='Rows' value='<%=Rows% >' size='4'></td>
<tr>
<td>ShowFileNam e</td>
<td> <input type="checkbox" name="ShowFilen ames" value="1" <%if
ShowFilenames Then %>checked<%end if%>></td>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Submit" name="ButtonSub mit"></td>
</tr>
</TABLE>
</FORM>
<p>FORM RESULTS</p>
<TABLE border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCC C">
<tr>
<td width="100">Col umns</td>
<td><%=Columns% ></td>
</tr>
<tr>
<td>Rows</td>
<td>
<%=Rows%>
</td>
<tr>
<td>ShowFileNam es</td>
<td>
<%=ShowFileName s%>
</td>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</TABLE>
<p>&nbsp;</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
=============== =============== ============


Jul 19 '05 #1
2 2189
I think you mean:
<%
If UCase(Request.S erverVariables( "REQUEST_METHOD ")) = "POST" Then
''your code
End If

Ray at home

"bart plessers" <ba**********@h otmail.com> wrote in message
news:uZ******** ******@TK2MSFTN GP11.phx.gbl...
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

Jul 19 '05 #2
Ray,

sometimes it is hard to run if you don't know how to walk...
Exactly what I needed again!

thanx
regards,
bartp

ps
I hope I don't give you to much work those days ... ;)

--
HyperART
Paul Van Ostaijenlaan 4
3001 Heverlee

"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
news:eb******** *****@TK2MSFTNG P12.phx.gbl...
I think you mean:
<%
If UCase(Request.S erverVariables( "REQUEST_METHOD ")) = "POST" Then
''your code
End If

Ray at home

"bart plessers" <ba**********@h otmail.com> wrote in message
news:uZ******** ******@TK2MSFTN GP11.phx.gbl...
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


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
6164
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number. "Decimal Number" sometimes serves to distinguish Base 10 numbers, eg "15", from Base 2 numbers, Eg "1111". At other times "Decimal Number" serves to differentiate a number from an integer. For the rest of this post I shall only use either...
1
1540
by: joe | last post by:
If I had a webpage that displayed a database in tabular form, it would be nice to know how many lines of text the browser could display without scrolling, then have the cgi script output the appropriate number of lines of data to fill the screen. I've seen examples of how to get the browser window size in pixels, but is there a way to determine the number of lines that are displayed? Thanks!
25
10286
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
13
7676
by: Gittyup | last post by:
Help please, We have a form, based on a query, that contains a listbox. The contents of the listbox are based on the results of the query. When the form is opened, the user selects an item from the listbox, and, using the AfterUpdate and Visible properties, a subform appears with information relative to the selected item. It works perfectly.
40
3011
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the front end open at the first form) and even though this links to the back-end files, there are no ldb files created. This is so I know when it is safe to compact the back-end files without going round to make sure everyone is logged off. User...
6
2885
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
10
43634
by: John Brown | last post by:
Hi there, Does anyone know how to (generically) determine the currently active form for an application using a "static" function (so I can call it from anywhere). There is no offiical way I've been able to find so I've written the following for starters: public static Form GetActiveForm() { // Returns null for an MDI app Form activeForm = Form.ActiveForm; if (activeForm == null) {
4
6074
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase this is all very difficult to explain in words, please bear with me as I endevour to explain what it is I am trying to do. It would be helpful if I could attach a graphics file to this posting that would help explain what it is I'm trying to achieve...
0
9872
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10945
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7858
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5696
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4499
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.