Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html form creates double record in database 1

Status
Not open for further replies.

PaulBricker

Programmer
Sep 25, 2002
3,554
US
This may be an HTML problem or it might be an ASP problem, but I have not figured out where the issue is so I thought I would start with the HTML forum. I have 3 html pages that contain forms on them. They are all very similar in style and content. All three send their info to ASP pages which insert the information into tables in the database. The problem is one of the tables in the database gets double records (duplicates) inserted. The other two only insert the expected single record. The form tags and the input type tags are identical in structure. This is the info in the offending form>

Code:
<form name = "workrequestform" id = "workrequestform" action = "workform.asp" method = "post">

<input type="image" src="button3.jpg" value="submit information" onclick = "javascript:document.workrequestform.submit()">

Now it may be the ASP page that is creating the problem, but the setup and structure of those pages are basically identical with each other as well. If anyone has any thoughts I'd apprciate any suggestions. I don't think people are double clicking the button because I've run sample data myself and I'm still seeing two records show up in that table.
It might not be either the HTML or the ASP, but something in my files I'm overlooking, but it's got me stumped so I'm looking for fresh ideas.

Thanks

Paul
 
Do all your submit buttons have that same Onlcick event?

If I was a betting man, I'd bet this might be a Javascript problem in the OnClick event.
Its definitely not an HTML issue.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks vacunita. The onclick events are identical except the form name is different in each. I will try asking in the javascript forum next.
Appreciate the sugestion.

Paul
 
vacunita, I posted in the javascript forum and got my solution. Thought you deserved a star for sending me that way.

Thanks

Paul
 
Glad you got it sorted out.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top