W obu przypadkach wysyłane są tylko nazwy zmiennych.
W przypadku GET'a URL wygląda następująco: index.php?plec=&telefon=
<html> <head> <meta charset="UTF-8" /> <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" rel="stylesheet" /> <script type="text/javascript"> $(function() { $("#dialog").dialog("destroy"); var plec = $("#plec"), telefon = $("#telefon"), allFields = $([]).add(plec).add(telefon), tips = $(".validateTips"); function updateTips(t) { tips .text(t) .addClass('ui-state-highlight'); setTimeout(function() { tips.removeClass('ui-state-highlight', 1500); }, 500); } function checkLength(o,n,min,max) { if ( o.val().length > max || o.val().length < min ) { o.addClass('ui-state-error'); updateTips("Length of " + n + " must be between "+min+" and "+max+"."); return false; } else { return true; } } function checkRegexp(o,regexp,n) { if ( !( regexp.test( o.val() ) ) ) { o.addClass('ui-state-error'); updateTips(n); return false; } else { return true; } } $("#dialog-form").dialog({ autoOpen: false, height: 300, width: 350, modal: true, buttons: { 'Prześlij ankietę': function() { var bValid = true; allFields.removeClass('ui-state-error'); bValid = bValid && checkLength(plec,"płeć",1,100); if(telefon.val().length > 0){ bValid = bValid && checkLength(telefon,"telefon",9,11); bValid = bValid && checkRegexp(telefon,/^([0-9])+$/,"Dozwolone tylko cyfry"); } if (bValid) { $(this).dialog('close'); $('form#test').submit(); } }, Anuluj: function() { $(this).dialog('close'); } }, close: function() { allFields.val('').removeClass('ui-state-error'); } }); $('#ankieta') .button() .click(function() { $('#dialog-form').dialog('open'); }); }); </script> </head> <body> <? if(isset($_GET['plec'])){ echo "płec: ".$_GET['plec']; echo "telefon: ".$_GET['telefon']; } ?> <div id="dialog-form" title="Ankieta"> <form id="test" method="GET"> <fieldset> <select name="plec" id="plec" class="text ui-widget-content ui-corner-all"> </select> <input type="text" name="telefon" id="telefon" value="" class="text ui-widget-content ui-corner-all" /> </fieldset> </form> </div> </body> </html>