Executing JS function onclick button which is present inside formAssign a custom image to product created programmatically-Magento 1.8Custom button in Admin FormHow to know that function is getting value form which file(model or class)Add confirmation pop-up to admin form “Save” buttonNeed help in add to cart with ajaxmagento add field dependency in admin form using a javascript functionApply class to radio button at Permission User Role formMagento2: Open new window on button onclickonclick login button results in ajax symbol instead of login to siteCall one function inside another controller function not workingonclick button all products deleting instead of one product

Scaling rounded rectangles in Illustrator

My parents are Afghan

Why doesn't increasing the temperature of something like wood or paper set them on fire?

How to get file name from inside a latex file?

Are modes in jazz primarily a melody thing?

Assuming a normal distribution: what is the sd for a given mean?

How can I test a shell script in a "safe environment" to avoid harm to my computer?

Justification of physical currency in an interstellar civilization?

What happens when the drag force exceeds the weight of an object falling into earth?

What does the copyright in a dissertation protect exactly?

Is there an idiom that means that a clothe fits perfectly?

shebang or not shebang

While drilling into kitchen wall, hit a wire - any advice?

Magical Modulo Squares

Does this website provide consistent translation into Wookiee?

What is the Ancient One's mistake?

Why doesn't Remus Lupin turn into a werewolf in the scene where Harry looks for Peter Pettigrew on the Marauder's Map?

If quadruped mammals evolve to become bipedal will their breast or nipple change position?

How to make a kid's bike easier to pedal

Is it safe to keep the GPU on 100% utilization for a very long time?

In a series of books, what happens after the coming of age?

What's the difference between "ricochet" and "bounce"?

Where do 5 or more U.S. counties meet in a single point?

What does “two-bit (jerk)” mean?



Executing JS function onclick button which is present inside form


Assign a custom image to product created programmatically-Magento 1.8Custom button in Admin FormHow to know that function is getting value form which file(model or class)Add confirmation pop-up to admin form “Save” buttonNeed help in add to cart with ajaxmagento add field dependency in admin form using a javascript functionApply class to radio button at Permission User Role formMagento2: Open new window on button onclickonclick login button results in ajax symbol instead of login to siteCall one function inside another controller function not workingonclick button all products deleting instead of one product






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















We have button "create" and onclick "Create" button, it will create product programmatically and assign custom image to that product.



app/design/frontend/rwd/Theme3/template/aitcg - js_styles1.phtml



<script>

var Aitcg_View_Abstract = Class.create(


_getControlPanelHtml: function()

if (this.config.editorEnabled)
return '<div>' +
'<button onclick="return setproductlogin('<?php echo Mage::registry("current_product")->getId()?>', event);setrequestlogin();" id="submit-editorApply-rand">create</button>' +
'<button>reset</button>' +
'</div>';

return '';
,

initObservers: function()

if (this.config.editorEnabled)
$('submit-editorApply-' + this.config.rand).observe('click', this.createDesignBut.bindAsEventListener(this));

,

createDesignBut: function(event)

Event.stop(event);
this.option.apply();
,
);

</script>


we are trying to do the same [ create product programtically and assign custom image ] , once we submit form by clicking "login button".
here we are creating product sucessfully, but custom image is not saving in server, to save custom image in server onclick "login" button, we are using same function that "create" button is using as below code :



app/design/frontend/rwd/Theme3/template/productlike - index.phtml



<form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', 
array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'),
'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">

// code for email id and password //

<button onclick="initObservers()" type="submit" title="<?php echo $this->__('Login') ?>"
name="send" id="send2"><span><?php echo $this->__('Login') ?></span>
</button>

</form>


but still custom image is not saving in server onclick "login" button.



Is this right way ?



updated code - >



 $images = array(
'thumbnail' => 'image.png', // displaying under cart
//'small_image' => 'image.png',
'image' => 'image.png' // displaying under my design
);

foreach ($images as $imageType => $imageFileName) {
if ($newImagePath != "")
$dir = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
$path = $dir . $newImagePath;
else
$dir = Mage::getBaseDir('media') . DS . 'example/amasty/';
$path = $dir . $imageFileName;










share|improve this question
























  • Where is the image code?

    – urfusion
    Apr 22 '17 at 6:03











  • @urfusion updated the question with image code ....can you check and do something pls......

    – raj
    Apr 22 '17 at 9:02

















0















We have button "create" and onclick "Create" button, it will create product programmatically and assign custom image to that product.



app/design/frontend/rwd/Theme3/template/aitcg - js_styles1.phtml



<script>

var Aitcg_View_Abstract = Class.create(


_getControlPanelHtml: function()

if (this.config.editorEnabled)
return '<div>' +
'<button onclick="return setproductlogin('<?php echo Mage::registry("current_product")->getId()?>', event);setrequestlogin();" id="submit-editorApply-rand">create</button>' +
'<button>reset</button>' +
'</div>';

return '';
,

initObservers: function()

if (this.config.editorEnabled)
$('submit-editorApply-' + this.config.rand).observe('click', this.createDesignBut.bindAsEventListener(this));

,

createDesignBut: function(event)

Event.stop(event);
this.option.apply();
,
);

</script>


we are trying to do the same [ create product programtically and assign custom image ] , once we submit form by clicking "login button".
here we are creating product sucessfully, but custom image is not saving in server, to save custom image in server onclick "login" button, we are using same function that "create" button is using as below code :



app/design/frontend/rwd/Theme3/template/productlike - index.phtml



<form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', 
array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'),
'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">

// code for email id and password //

<button onclick="initObservers()" type="submit" title="<?php echo $this->__('Login') ?>"
name="send" id="send2"><span><?php echo $this->__('Login') ?></span>
</button>

</form>


but still custom image is not saving in server onclick "login" button.



Is this right way ?



updated code - >



 $images = array(
'thumbnail' => 'image.png', // displaying under cart
//'small_image' => 'image.png',
'image' => 'image.png' // displaying under my design
);

foreach ($images as $imageType => $imageFileName) {
if ($newImagePath != "")
$dir = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
$path = $dir . $newImagePath;
else
$dir = Mage::getBaseDir('media') . DS . 'example/amasty/';
$path = $dir . $imageFileName;










share|improve this question
























  • Where is the image code?

    – urfusion
    Apr 22 '17 at 6:03











  • @urfusion updated the question with image code ....can you check and do something pls......

    – raj
    Apr 22 '17 at 9:02













0












0








0








We have button "create" and onclick "Create" button, it will create product programmatically and assign custom image to that product.



app/design/frontend/rwd/Theme3/template/aitcg - js_styles1.phtml



<script>

var Aitcg_View_Abstract = Class.create(


_getControlPanelHtml: function()

if (this.config.editorEnabled)
return '<div>' +
'<button onclick="return setproductlogin('<?php echo Mage::registry("current_product")->getId()?>', event);setrequestlogin();" id="submit-editorApply-rand">create</button>' +
'<button>reset</button>' +
'</div>';

return '';
,

initObservers: function()

if (this.config.editorEnabled)
$('submit-editorApply-' + this.config.rand).observe('click', this.createDesignBut.bindAsEventListener(this));

,

createDesignBut: function(event)

Event.stop(event);
this.option.apply();
,
);

</script>


we are trying to do the same [ create product programtically and assign custom image ] , once we submit form by clicking "login button".
here we are creating product sucessfully, but custom image is not saving in server, to save custom image in server onclick "login" button, we are using same function that "create" button is using as below code :



app/design/frontend/rwd/Theme3/template/productlike - index.phtml



<form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', 
array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'),
'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">

// code for email id and password //

<button onclick="initObservers()" type="submit" title="<?php echo $this->__('Login') ?>"
name="send" id="send2"><span><?php echo $this->__('Login') ?></span>
</button>

</form>


but still custom image is not saving in server onclick "login" button.



Is this right way ?



updated code - >



 $images = array(
'thumbnail' => 'image.png', // displaying under cart
//'small_image' => 'image.png',
'image' => 'image.png' // displaying under my design
);

foreach ($images as $imageType => $imageFileName) {
if ($newImagePath != "")
$dir = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
$path = $dir . $newImagePath;
else
$dir = Mage::getBaseDir('media') . DS . 'example/amasty/';
$path = $dir . $imageFileName;










share|improve this question
















We have button "create" and onclick "Create" button, it will create product programmatically and assign custom image to that product.



app/design/frontend/rwd/Theme3/template/aitcg - js_styles1.phtml



<script>

var Aitcg_View_Abstract = Class.create(


_getControlPanelHtml: function()

if (this.config.editorEnabled)
return '<div>' +
'<button onclick="return setproductlogin('<?php echo Mage::registry("current_product")->getId()?>', event);setrequestlogin();" id="submit-editorApply-rand">create</button>' +
'<button>reset</button>' +
'</div>';

return '';
,

initObservers: function()

if (this.config.editorEnabled)
$('submit-editorApply-' + this.config.rand).observe('click', this.createDesignBut.bindAsEventListener(this));

,

createDesignBut: function(event)

Event.stop(event);
this.option.apply();
,
);

</script>


we are trying to do the same [ create product programtically and assign custom image ] , once we submit form by clicking "login button".
here we are creating product sucessfully, but custom image is not saving in server, to save custom image in server onclick "login" button, we are using same function that "create" button is using as below code :



app/design/frontend/rwd/Theme3/template/productlike - index.phtml



<form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', 
array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'),
'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">

// code for email id and password //

<button onclick="initObservers()" type="submit" title="<?php echo $this->__('Login') ?>"
name="send" id="send2"><span><?php echo $this->__('Login') ?></span>
</button>

</form>


but still custom image is not saving in server onclick "login" button.



Is this right way ?



updated code - >



 $images = array(
'thumbnail' => 'image.png', // displaying under cart
//'small_image' => 'image.png',
'image' => 'image.png' // displaying under my design
);

foreach ($images as $imageType => $imageFileName) {
if ($newImagePath != "")
$dir = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
$path = $dir . $newImagePath;
else
$dir = Mage::getBaseDir('media') . DS . 'example/amasty/';
$path = $dir . $imageFileName;







magento-1.8 javascript image forms third-party-module






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 3 at 19:52









Ghulam.M

472113




472113










asked Apr 21 '17 at 13:11









rajraj

4912




4912












  • Where is the image code?

    – urfusion
    Apr 22 '17 at 6:03











  • @urfusion updated the question with image code ....can you check and do something pls......

    – raj
    Apr 22 '17 at 9:02

















  • Where is the image code?

    – urfusion
    Apr 22 '17 at 6:03











  • @urfusion updated the question with image code ....can you check and do something pls......

    – raj
    Apr 22 '17 at 9:02
















Where is the image code?

– urfusion
Apr 22 '17 at 6:03





Where is the image code?

– urfusion
Apr 22 '17 at 6:03













@urfusion updated the question with image code ....can you check and do something pls......

– raj
Apr 22 '17 at 9:02





@urfusion updated the question with image code ....can you check and do something pls......

– raj
Apr 22 '17 at 9:02










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f171175%2fexecuting-js-function-onclick-button-which-is-present-inside-form%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f171175%2fexecuting-js-function-onclick-button-which-is-present-inside-form%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?