Hi All,
Requirement: Using DrupalGap, I want to add a product to database with product image.
In my form I have buttons for 'capture image' and 'browse image'. After capture the image using file_save() I upload and store the image details in the database. Including the 'fid' in the file_save() function's success callback, I have stored the rest of the product details in the database. All the things are working successfully, but there is a delay after pressing the 'Save' button. This tempts the user to press the save button again, which cause multiple product creation. I tried to disable the button the save button's click() function, it works but took time.
I have noticed one thing, if I avoid the image file upload it works instantly. Soon after the save button press, the button is disabled.
Why if the fid is there in the form, submit tooks time?
The real file upload is not happening when the capture image save?
If it is not happening then how it gets the 'fid'?
How can I disable the save button instantly with the product creation with image?
Regards,
Saneesh.
Comments
Comment #2
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedAre you using a form built into DrupalGap? (i.e. the node add/edit form). Or are you building your own custom form?
Comment #3
Saneesh CreditAttribution: Saneesh commentedHello Tyler,
I'm using custom form.
Regards,
Saneesh.
Comment #4
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedFirst, make sure your custom form element(s) don't use field machine names, that will confuse the DrupalGap Form State Values assembly mechanism. Please share some code, otherwise it's hard to guess what's going on.
Comment #5
Saneesh CreditAttribution: Saneesh commentedHello Tyler,
Sorry to late reply.
These are my add and edit functions: