Hi,

I'm building a custom wordpress plugin that involves submitting data using a form. The form works quite well but it is susceptible to double submission. How can I prevent double form submission?

I used this. It disables the submit button but it prevents inserting of the values into the database table:

<form ... onsubmit="myButton.disabled = true; return true;">

How can I fix this?

Thanks in advance!

Is there another form on the page with the same field name/ids?

Yeah, there was. I changed their names.

I started using this and it works just fine (It hides the submit button after clicking it.):

 <input type='submit'... onclick="this.style.visibility='hidden'/>

Thanks. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.