469,275 Members | 1,825 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

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 2610
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Steve | last post: by
8 posts views Thread by bettina | last post: by
13 posts views Thread by teddy.am | last post: by
4 posts views Thread by Alex Sibilev | last post: by
5 posts views Thread by Navillus | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.