Multiple submit problem in CActiveForm Multiple submit problem in CActiveForm
Posted 16 July 2012 - 09:35 AM
My problem is as follows: my form writes multiple entries in the database even after I have disabled the submit button on click. I have also tried hiding the button's div on click. I find it very strange that even if I disable the button on click, the data is doubled in the database. I think I have looked everywhere, and still haven't found a solution. This isn't a problem of multiple clicking. Based on how many drop-down lists I select in my form before pressing submit, or on how many text fields I fill in, I have noticed that more duplicate entries are written in the database. I can get up to 7+ duplicate entries in the database.
Any idea why this is happening, and how I can solve it?
Posted 16 July 2012 - 11:23 AM
Posted 16 July 2012 - 12:46 PM
Well, I only have client validation enabled now, and it seems to work without Ajax validation. I don't have any auto-complete fields. I don't understand why having Ajax validation enabled causes such problems.
Posted 17 July 2012 - 02:27 AM
Did you use firebug (or something like this) to debug how many request are fired from client? To see what is validation and what is an submitted form (in order to insert this into the DB).