We have 2 buttons in product view page
1)Create - create product programtically
2)Add to cart - Add product to cart & creating product programatically.
Issue is we dont need to create product once click on "Add to cart"
create button code
<button id="submit-editorApply-{{rand}}" onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();" >
 create
 </button>
Add to cart
<button onclick="productAddToCartForm.submit(this)" id="submit-editorApply-add-to-cart">
 Add to cart>
 </button> 
related code
initObservers: function() 
 { 
 if (this.config.editorEnabled) { 
 $('submit-editorApply-' + this.config.rand).observe('click', this.saveDesignBut.bindAsEventListener(this));
 $('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this)); 
 } 
 }, 
submitApply: function(event) 
 { 
 Event.stop(event); 
 this.option.apply(); 
 if(window.productAddToCartForm == 'undefined') { 
 var productAddToCartForm = new VarienForm('product_addtocart_form'); 
 } else { 
 var productAddToCartForm = window.productAddToCartForm; 
 } 
 productAddToCartForm.submit(); 
 },
Update
once i remove function : submitApply: function(event) [see full function above ] , than Add to cart button will not create any product. but after that, we need to click on create button to click on Add to cart, otherwise Add to cart will not work....
update 2
when i hide this code : $('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this)); & removed aitcg-required , than both features will work, but one more issue will create that once we click directly on add to cart [ without click on create] button, than in cart page, we dont see custom image : 
1 Answer 1
Please check whether two buttons have same form functionality..so it will create an issue.
You have to divide both functionality with help of separate forms
- 
 1@ Nihar S : How To Display Tooltip When Customer On Mouse Hover Add to Cart Buttonuser51361– user513612017年04月25日 06:09:12 +00:00Commented Apr 25, 2017 at 6:09