Hi,
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?
Page 1 of 1
Multiple submit problem in CActiveForm Multiple submit problem in CActiveForm
#2
Posted 16 July 2012 - 09:56 AM
If the last field in my form is a text field, which is required/mandatory ( as set in the model ), and I write in that field , the problem disappears in Chrome, but I get double entries in Firefox...
#3
Posted 16 July 2012 - 10:10 AM
I hope this link works so you can see my _form view: http://pastebin.com/iqXtV2VY
#4
Posted 16 July 2012 - 10:22 AM
The problem seems to solve itself if I disable Ajax validation... Do I need that kind of validation?
#6
Posted 16 July 2012 - 12:46 PM
yogobili, on 16 July 2012 - 11:23 AM, said:
If you need a client-side validation and use some autocomplete etc. things then you should use Ajax validation
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.
#7
Posted 17 July 2012 - 02:27 AM
Could it be possible, the your validation-code and your save-code is bundled together, so that the first DB insert happed at validation time?
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).
rall0r
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).
rall0r
Share this topic:
Page 1 of 1

Help













