Salve a tutti ho scaricato uno script che realizza l'effetto overlay e su questo overlay io vorrei metterci un form che deve essere compilato e poi inviato. Se io uso questo codice :
come faccio poi dopo aver premuto ok a far inviare il dati del form ?
Codice:
<!-- default set of jQuery Tools + jQuery 1.3.2 -->
<script src="jquery.tools.min.js"></script>
<link rel="stylesheet" type="text/css" href="modal.css" />
<!-- the triggers -->
<p>
<button class="modalInput" rel="#yesno">Yes or no?</button>
<button class="modalInput" rel="#prompt">User input</button>
</p>
<!-- yes/no dialog -->
<div class="modal" id="yesno">
<h2>This is a modal dialog</h2>
<p>
You can only interact with elements that are inside this dialog.
To close it click a button or use the ESC key.
</p>
<!-- yes/no buttons -->
<p>
<button class="close"> Yes </button>
<button class="close"> No </button>
</p>
</div>
<!-- user input dialog -->
<div class="modal" id="prompt">
<h2>This is a modal dialog</h2>
<p>
You can only interact with elements that are inside this dialog.
To close it click a button or use the ESC key.
</p>
<?php echo "valore : " . $_POST['prova']; ?>
<!-- input form. you can press enter too -->
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="prova" />
<input type="submit" value="OK"> OK </button>
<button type="button" class="close"> Cancel </button>
</form>
<br />
</div>
<script>
// What is $(document).ready ? See: http://flowplayer.org/tools/using.html#document_ready
$(document).ready(function() {
var triggers = $("button.modalInput").overlay({
// some expose tweaks suitable for modal dialogs
expose: {
color: '#333',
loadSpeed: 200,
opacity: 0.9
},
closeOnClick: false
});
var buttons = $("#yesno button").click(function(e) {
// get user input
var yes = buttons.index(this) === 0;
// do something with the answer
triggers.eq(0).html("You clicked " + (yes ? "yes" : "no"));
});
$("#prompt form").submit(function(e) {
// close the overlay
//triggers.eq(1).overlay().close();
// get user input
//var input = $("input", this).val();
// do something with the answer
//triggers.eq(1).html(input);
// do not submit the form
return e.preventDefault();
});
});
</script>
come faccio poi dopo aver premuto ok a far inviare il dati del form ?