A.html
<script type='text/javascript' src='jquery/Pytanie.js'></script> <td><input name="model" id="model" type="text" /></td> <div id='confirm-dialog'> <input type='button' name='confirm' class='confirm' value='Dalej'/> <div class='no simplemodal-close'>Nie
</div><div class='yes'>Tak
</div> <div style='display:none'> <img src='img/confirm/header.gif' alt='' /> <img src='img/confirm/button.gif' alt='' /> <img src="photoopis/stopka-email.jpg"/>
Pytanie.js
jQuery(function ($) {
$('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
e.preventDefault();
// example of calling the confirm function
// you must use a callback function to perform the "yes" action
confirm
("Dawaj kase
", function () { window.location.href = 'B.php';
});
});
});
function confirm(message, callback) {
$('#confirm').modal({
closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
position: ["20%",],
overlayId: 'confirm-overlay',
containerId: 'confirm-container',
onShow: function (dialog) {
var modal = this;
$('.message', dialog.data[0]).append(message);
// if the user clicks "yes"
$('.yes', dialog.data[0]).click(function () {
// call the callback
if ($.isFunction(callback)) {
callback.apply();
}
// close the dialog
modal.close(); // or $.modal.close();
});
}
});
}
B.php
<?php
$model=$_SESSION['model'];
?>
Chodzi o przekazanie wartości model. Oczywiście moj kod troszkę uprościłem, ale idea jest w tym pokazana.