you cant check if submit is already pressed because if they press submit, they wont be on that page anymore
question: body onUnload="checkbutton(this);" i need to send the form object, how to do that? PS. good news --- i think i have a solution
you saying there is NOT a way to know if the submit button has been pressed, UNLESS you are on the next page? isn't the onunload event, the last thing that happens before page leaves -- wouldn't the button value be set at that point?
< body .... onunload="javascript:checkbutton(document.form1.elements["hid"].value);" > that does not work? i have a hidden fields: hid in the form, how can i send that?
in case anyone cares i solved my problem perfectly... with one new thought... page 1 - submits (data is saved to DB) then to page 2 using the onunload="javascript:myfunctinoname();" i call an ajax script that calls a php script that updates the DB record to complete. so if visitor leaves (record gets completed) or if user submits page 2 (record gets completed AND same functionality exist--- which was to delete old record and insert new record with both pages of data) so, the new thought to solved the problem, i completed the record and didn't care about checking if the submit button was pressed or not. NOTE: i got rid of 2 records issue and the human problem is not a problem because the delete/insert happens back to back -- so no time delay. thanks for you help