JQuery color and shape

I have a form that I want to submit and show in Colorbox.

Form - Mals Ecommerce View Cart.

See: https://www.mals-e.com/tpv.php?tp=4

I want it to display the contents of the cart in the iframe colorbox. Can this be used using the FORM method rather than the Link method?

+3
source share
4 answers

here is the best answer.

add this to your submitbutton: id = "SearchButton"

then use this:

$(document).ready(function() {
    $("input#SearchButton").colorbox({href: function(){
        var url = $(this).parents('form').attr('action');
        var ser = $(this).parents('form').serialize(); //alert(url+'?'+ser);
        return url+'?'+ser;
    }, innerWidth:920, innerHeight:"86%", iframe:true});
});

test at: http://wwww.xaluan.com or http://wwww.xaluan.com/raovat/

+4
source

, :

$("#submit_button").click(function () { // ATTACH CLICK EVENT TO MYBUTTON
    $.post("/postback.php",        // PERFORM AJAX POST
      $("#info_form").serialize(),      // WITH SERIALIZED DATA OF MYFORM
      function(data){                // DATA NEXT SENT TO COLORBOX
        $.colorbox({
          html:   data,
          open:   true,
          iframe: false            // NO FRAME, JUST DIV CONTAINER?
        });
      },
      "html");
  });

.. Colorbox jQuery. , -.

+3

Try

$("input#formsubmit").colorbox({title: function(){
    var url = $(this).parents('form').attr('action');
}});

, Colorbox. "formubmit" .

0

colorbox , :

jQuery.colorbox({href:, iframe: true, opacity: 0.6, innerWidth: 760, innerHeight: 420, title:});

, :

jQuery ( "document" ). ready (function() {jQuery.colorbox..});

u , . . ., .

jQuery.colorbox()

0

Source: https://habr.com/ru/post/1739480/


All Articles