473,382 Members | 1,786 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,382 software developers and data experts.

ASP Form Doesn't Always Submit

Hello everyone,

I am pretty much newbie to ASP so please bear with me as I explain my
problem. I currently have a main form which displays data queried
from a SQL database. From that main page I have a hyperlink which
opens a child window and allows edits to the data displayed on the
parent form. As the child form is submitted, it is updating the
database, then it refreshes the parent page and closes itself. That
all works properly, however, sometimes after pressing the update
button nothing is submitted. It looks as though it has been submitted
but when running 'profiler' I see that there have been no sql updates
against the db. When I remove the window.close(performed directly
after the submit, see below) from the child form it works everytime
without fail. Is it possible that the form sometimes closes before
the submit is actually finished? Any help/advice is greatly
appreciated! Thanks!
function updateRecord()

'check with the user
response=confirm("Update record?")

if response=true then
document.forms("editcontacts").SubmitType.value="u pdate"
document.forms("editcontacts").Submit()

window.opener.location.reload()
window.close
end if

end function
Jul 19 '05 #1
1 2725
It's safer to submit the form, then on the receiving form, after all of the
data is validated and the database updated, send the close and refresh code.

"Eric" <te******@yahoo.com> wrote in message
news:1a**************************@posting.google.c om...
Hello everyone,

I am pretty much newbie to ASP so please bear with me as I explain my
problem. I currently have a main form which displays data queried
from a SQL database. From that main page I have a hyperlink which
opens a child window and allows edits to the data displayed on the
parent form. As the child form is submitted, it is updating the
database, then it refreshes the parent page and closes itself. That
all works properly, however, sometimes after pressing the update
button nothing is submitted. It looks as though it has been submitted
but when running 'profiler' I see that there have been no sql updates
against the db. When I remove the window.close(performed directly
after the submit, see below) from the child form it works everytime
without fail. Is it possible that the form sometimes closes before
the submit is actually finished? Any help/advice is greatly
appreciated! Thanks!
function updateRecord()

'check with the user
response=confirm("Update record?")

if response=true then
document.forms("editcontacts").SubmitType.value="u pdate"
document.forms("editcontacts").Submit()

window.opener.location.reload()
window.close
end if

end function

Jul 19 '05 #2

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

Similar topics

8
by: Matt | last post by:
I want to submit the form to the server without opening another page. When we do the following, it will submit the form data in myform to the IIS, and open page2.asp. <form name="myform"...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
4
by: Steve | last post by:
Hi everyone, I have a test page. When I press the button, it bring form.html, which is fine. When I press Enter key in the textbox, it gives me an error saying this.form.cmd is not an object. ...
2
by: webbedfeet | last post by:
Hi I hope someone can help me. I have a client side form validation script which works perfectly in IE but clicking "Submit" in Mozilla does nothing - the form won't submit. Is there something I...
8
by: bettina | last post by:
I want to submit a form but without a submit button. That's to say, I want that by giving a definite code in a field and then press <ENTER> the form will be submitted. For Example <form...
13
by: teddy.am | last post by:
I know this is stupid, but i've been trying to process a form while adding a function to the onClick event. as soon as i add the onClick event, the function is triggerred but the form doesn't...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
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...
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
3
by: annoula | last post by:
Hello, I'm sorry if this has come up before but I haven't been able to find a solution in any forum so far. I have a page with 2 forms. One form contains links that the user clicks to navigate...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.