I am using Oracle 9i and ASP
I have empno, empname, designation, category, dob.
Category have two option 'S' or 'O'
When I enter empno, empname, designation, category and dob
and when I press enter key all the data remains on the form but only list value is lost. what should I do ? How can I solve this. -
<%@ Language=VBScript%>
-
<%Option Explicit%>
-
<html>
-
<head>
-
<title>Barauni Refinery - Post Retirement Data Management </title>
-
</head>
-
<%
-
Dim R
-
Dim R1
-
Dim vempno, vempname, vdesign, vcategory
-
Dim vdobyyyy, vdobmm, vdobdd
-
If Not IsEmpty(Request.Form("submit")) then
-
vempno = Request.Form("vempno")
-
vempname = Request.Form("vempname")
-
vdesign = Request.Form("vdesign")
-
vcategory = Request.Form("vcategory")
-
vdobyyyy = Request.Form("vdobyyyy")
-
vdobmm = Request.Form("vdobmm")
-
vdobdd = Request.Form("vdobdd")
-
If len(vempno) = 0 then
-
errorMsg = "You must enter employee number."
-
End If
-
If len(errorMsg) = 0 Then
-
If len(vempname) = 0 Then
-
errorMsg = "Your must enter either employee name."
-
Elseif len(vempname) > 20 Then
-
errorMsg = "The employee name > 20 characters. Please reduce the size."
-
Else
-
For i = 1 to len(vempname)
-
If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vempname, i, 1), vbTextCompare) = 0 then
-
errorMsg = "The employee name is invalid. Please re-enter this field."
-
Exit For
-
End If
-
Next
-
End If
-
End If
-
If len(errorMsg) = 0 Then
-
conn.Close
-
conn.Mode = adModeReadWrite
-
conn.Open
-
R.Open "Select * from SABF", conn, 2, 3
-
R.Addnew
-
R("empno") = vempno
-
R("empname") = vempname
-
R("design") = vdesign
-
R("category") = vcategory
-
R("dob") = Cdate(vdobmm & "/" & vdobdd & "/" & vdobyyyy)
-
R.UPdate
-
End If
-
End If %>
-
<form method="POST" action="sabf.asp">
-
<%
-
If len(errorMsg) > 0 Then
-
Response.Write "<p><font color='red'>" & errorMsg & "</font></p>"
-
End If
-
%>
-
-
<table width=900>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="center"><font face="arial"><h3>SABF Entry</h3></font></h3>
-
</tr>
-
-
</table>
-
</tr>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="right"><font face="arial" size=2>Employee No : </font></td>
-
<td align='left'><input type="text" style="width:100px" name="vempno" value="<%=vempno%>"></td>
-
<td align="right"><font face="arial" size=2>Employee Name : </font></td>
-
<td align='left'><input type="text" style="width:300px" name="vempname" value="<%=vempname%>"></td>
-
</tr>
-
<tr>
-
<td align="right"><font face="arial" size=2>Designation : </font></td>
-
<td align='left'><input type="text" style="width:200px" name="vdesig"></td>
-
<td align="right"><font face="arial" size=2>Category : </font></td>
-
<td align="left">
-
<font face="arial" size=2><select name="vcategory" value="<%=vcategory%>">
-
<option value="O">Officer</option>
-
<option value="S" selected>Staff</option></select>
-
</font>
-
</td>
-
</tr>
-
<tr>
-
<td align="right"><font face="arial" size=2>Date of Birth : </font></td>
-
<td>
-
<select name="vdobyyyy" value="<%=vdobyyyy%>">
-
<%i=1965
-
do while i <= 2010
-
If i = 2009 Then%>
-
<option value="2009" selected>2009</option>
-
<%Else%>
-
<option value="<%=i%>"><%=i%></option>
-
<%End If
-
i = i + 1
-
loop%>
-
</select>
-
<select name="vdobmm" value="<%=vdobmm%>">
-
<%i=1
-
Do while i <= 12
-
If i = Cint(vdobmm) then%>
-
<option value="<%=vdobmm%>" selected><%=vdobmm%></option>
-
<%Else%>
-
<option value="<%=i%>"><%=i%></option>
-
<%End If
-
i = i + 1
-
loop%>
-
</select>
-
<select name="vdobdd" value="<%=vdobdd%>">
-
<%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
-
no_of_day = 29
-
ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then
-
no_of_day = 28
-
ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then
-
no_of_day = 30
-
Else
-
no_of_day = 31
-
End If
-
i=1
-
Do while i <= no_of_day
-
If i = Cint(vdobdd) Then%>
-
<option value="<%=vdobdd%>" selected><%=vdobdd%></option>
-
<%Else%>
-
<option value="<%=i%>"><%=i%></option>
-
<%End If
-
i = i + 1
-
loop%>
-
</select><font color='blue' size=2>(yyyy-mm-dd)</font>
-
</td>
-
</tr>
-
<tr>
-
<table align="center">
-
<tr>
-
<td align="center"><input type="Submit" name="submit" value="Save">
-
<input type="reset" name="reset" value="Reset">
-
</td>
-
</tr>
-
</table>
-
</tr>
-
</table>
-
</form>
-
</body>
-
</html>
-
0 1428 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jeremy Epstein |
last post by:
I've got a 4-page form that lets users enter a whole lot of information,
which is then submitted and emailed at the end. All the fields are
stored as session data.
The whole thing works fine:
1. On my local box (WinXP / Apache2 / PHP4) using IE6
2. On my local box using Firefox1
3. On my hosted server (RHLinux / Apache1.3 / PHP4) using IE6
|
by: Mark R |
last post by:
I have one .asp page with a SELECT pulldown list on it and some INPUT
fields. When SUBMIT is clicked the form data is submitted to that same page
and validated. If INPUT fields are empty the asp code will insert a visual
indicator (e.g. *) to convey that the field must be filled in.
However, if the user has made a selection in the pulldown list and has left
an INPUT field empty, when the form reappears after validation, the pulldown
menu...
|
by: dmiller23462 |
last post by:
So here's my problem.....I need to set up different email
distributions based on which option in the following Select form has
been chosen....For instance if "Putaway" is chosen it needs to email
User1@here.whatever and User4@here.whatever but if "Loaded" is chosen
it needs to email User2@here.whatever and User3@here.whatever, etc,
etc...
I'm aware that the only thing that really needs to change is the
"Mail.AddAddress" line (at least...
|
by: ckerns |
last post by:
I want to loop thru an array of controls,(39 of them...defaults = 0).
If value is null or non-numeric I want to assign the value of "0".
rowString = "L411" //conrol name
if (isNaN(eval ("document.forms."+rowString+".value")) == true )
{
//this alert works if the value is a letter,i.e,"a"
alert("You have entered an non-numeric value.\nEnter a number
in the appropriate box.");
|
by: cmc_dermo |
last post by:
I have a form that has a select list.
A user chooses a value and the page refreshes showing the selected
value in the dropdown box.
So I want to use Javascript to get the selected query from the form.
I then want to pass it as a hidden field.
So for example the section of the page I'm interested in will look like
| |
by: Ashish |
last post by:
Hi All,
I have a server runnable textbox control. I also have a server side button
object but I hook up javascript to it to show a modal dialog. Upon return it
places the value in the textbox (client side script). The problem is that
after it places the value, postback occurs and value is lost. I have tried
overriding SaveViewState and LoadViewState but it doesnt help (for some
super cool reason load is called first after postback rather...
|
by: Celine |
last post by:
I have a webform with multiple panels with textboxes, dropdownlists,
radiobuttonlists, etc. The user navigates through the panels and then
submits the information at the end.
The first panel contains a text box where users can enter a search term. A
"next" button displays the following panel causing a stored procedure to
populate a dropdown list. The dropdown list displays the results of the
search, and requires users to select an...
|
by: Mike Collins |
last post by:
I cannot get the correct drop down list value from a drop down I have on my
web form. I get the initial value that was loaded in the list.
It was asked by someone else what the autopostback was set to...it is set to
false.
Can someone show me what I am doing wrong and tell me the correct way? Thank
you.
In the page load event, I am doing the following:
|
by: godkrishna |
last post by:
Hi Guys.. I am new to javascript.. pls bare with me :)
In my form, i have a table with two columns. first column has checkboxes and second has dropdown lists.
On check of each check box.. certain 'options' are addded/removed from its corresponding dropdown list.
My problem is, after adding/removing the 'options' dynamically, if I select the newly added option and submit the form, the corresponding value for the newly added option is...
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |