473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Suspecting submit form error

I have an ASP UI with VB Dll as a COM object that access the DB2
Database.

I have a "Calculate" button on the ASP Page which when clicked does form
validation (javascript) and submits the form (Javascript) to the same
ASP page. When the ASP page receives the form information it stores all
the form information in VB properties and then eventually saves it to
the Database. After that it retrieves the values back from the VB
properties so as to pass it down to the client to load the same ASP Page
again with the values that were selected as well as creates a PDF
document in a new window (Lets call it Window XYZ).
So far everything is working fine. If I let that window XYZ with the PDF
document stay open and hit the CALCULATE button again, it generates a
new PDF in the XYZ window but does not have any information from the
page that I hit the CALCULATE button from. When I look in the database,
the information from the page where i hit the calculate button has been
wiped out thus explaining why it didn't show up on the new PDF. Also the
ASP page has lost its information thus while doing the save in the
database it wiped out the previous values in the database thus
explaining why the Database doesn't have it. But if i close the XYZ
window and then hit the Calculate button then the PDF document comes up
with the right information. So every time I want to hit the Calculate
button I have to close the XYZ window from the previous time in order to
make sure that my information doesn't get deleted. I forgot to mention
earlier that the new window XYZ opens up due to the target being set to
NEW while doing the submit form.

Sample ASP page Code:
javascript: (The javascript is actually in an external file which is
included in the page. I have just copied and pasted the code that really
matters in this page.
<HTML>
<HEAD>
function ValidateForm()
{ //Does some data validation and then submits

eval(document.frmPlcyPropInfo.target = '_new') ;
eval(document.frmPlcyPropInfo.action = 'PlcyPropInfo.asp?Action=5') ;
eval( "document." + FormName + ".submit()" ) ;
}

Dim CltProg
ActionVal = Request.QueryString( "Action" )
If ActionVal = 5 then '---5 meaning you hit the calculate button
PlcyPropInfo.Program = request.form("txtProgram") --stores the form
data into VB property
PlcyPropInfo.SaveData() -- does the actual save to the Database
PrintPDF --- prints the PDF in the new XYZ Window
End If

CltProg = PlcyPropInfo.Program -- retrieves the value from VB and
stores in this variable which is used in the HTML to re-populate the
field which was selected by the user

</HEAD>
<BODY Language="Javascript">
<FORM name=frmPlcyPropInfo Method="POST">

<span class="DoPos" id=spnInside style="LEFT: 7%; TOP:
37%">Inside</span>
<input id="txtProgram" name="txtProgram" class="Mask" style="LEFT: 17%;
TOP: 37%; WIDTH:15%" MASK="currency" tabindex=5 maxlength=12
value=<%=CltProg%>>

<INPUT CLASS="DoPos" id="cmdCalculate" name="cmdCalculate" type="button"
value="Calculate" style="LEFT:80%;TOP:10%;WIDTH:15%;HEIGHT:6%"
LANGUAGE=javascript onclick="return ValidateForm()">

Can somebody point out to where I could be having a problem?
I apologize for the lengthy post but thought would help if I expalined
the problem in detail.

*** Sent via Developersdex http://www.developersdex.com ***
Sep 30 '05 #1
1 1705
Correction to my Javascript function. It should be without the eval
function.
document.frmPlcyPropInfo.target = '_new';
document.frmPlcyPropInfo.action = 'PlcyPropInfo.asp?Action=5');
document.frmPlcyPropInfo.submit());
*** Sent via Developersdex http://www.developersdex.com ***
Sep 30 '05 #2

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

Similar topics

4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
8
by: Syed Ali | last post by:
Hello, I have 1 HTML form with 4 submit buttons and 10 textfield entry areas. If submit button1 is pressed I need to make sure that all 10 textfield entries have been filled before submitting...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
9
by: scott | last post by:
I have a combo in LISTING 2 that I'm trying to force a sumbit when a user makes a change. Can anyone see why it doesn't fire LISTING 2 code? It just doesn't do anything. What I'm really trying to...
4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.