data

-First Create test.php file -copy all code and paste in file -Then run on localhost -fisrt time load file thane save data without load -save data only one click. YOUR Custom Form :

<input value=”getId() ?>” name=”fancy_product” type=”hidden”> Email request for lowest price of getName()?>

    •  

* Required Fields

<button type=”submit” title=”__(‘Submit’) ?>” class=”button”>__(‘Submit’) ?> <img src=”getSkinUrl(“images/opc-ajax-loader.gif”)?>”>

  YOUR script :

    //var dataForm = new VarienForm('lowest-form-validate', true);
    //<![CDATA[
    var formId = 'lowest-form-validate';
    var myForm = new VarienForm(formId, true);
    //var postUrl = '';
    var postUrl = "";
    function doAjax() {
        if (myForm.validator.validate()) {
            new Ajax.Updater(
                { success:'formLowestSuccess' }, postUrl, {
                    method:'post',
                    asynchronous:true,
                    evalScripts:false,
                    onComplete:function(request, json) {
                        Element.hide(formId);
                        Element.show('formLowestSuccess');
                    },
                    onLoading:function(request, json){
                        Element.show('formLoader');
                    },
                    parameters: $(formId).serialize(true),
                }
            );
        }
    }
    new Event.observe(formId, 'submit', function(e){
        e.stop();
        doAjax();
    });
 
//end of javascript code
}}
>

About Author:

Kalpesh Chavada

Kalpesh Chavada is Our Founder & CEO of Akshar Group Technologies. He is serving with 11+ years of experience in different technologies like Magento, WordPress, Laravel, jQuery, Shopify, Branding, and Digital Marketing. He is very good with creative logic and always ready to take on challenges.

Kalpesh Author