By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,847 Members | 2,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

ASP Form Doesn't Always Submit

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.