Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP Form Doesn't Always Submit

Reply
Thread Tools

ASP Form Doesn't Always Submit

 
 
Eric
Guest
Posts: n/a
 
      09-19-2003
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
 
Reply With Quote
 
 
 
 
Tom B
Guest
Posts: n/a
 
      09-19-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert form to submit on load instead of clicking submit button? Network-Man HTML 5 07-07-2012 12:06 PM
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
Forms with multiple submit buttons vs 'form' objects with single 'submit' methods neil.fitzgerald@ic.ac.uk Python 4 04-14-2006 04:58 PM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM
Form submit - hitting enter does not trigger Submit button ASP General 2 10-25-2004 03:37 PM



Advertisments