Reputation: 1430
I have the simple form
<form id="myForm" method="POST" action="">
<input type="text" id="order" name="order" value="<?php echo order_id ?>" />
<button type="submit" name="order" form="form-order" id="button-send" title="My order" onclick="send('http://myurl.com/data/send.php');"></button>
</form>
and aJax function:
function send(url) {
$.ajax({
type: 'post',
url: url,
data: $('#order'),
dataType: 'json',
beforeSend: function() {
$('#button-send').button('loading');
},
complete: function() {
$('#button-send').button('reset');
},
});
}
all working, but before submit I need post order_id
to handle some additional information in send.php file and after that submit this info.
order_id
I posting and storing it in $_SESSION
.
It is possible to send order_id
to the file before submit?
Upvotes: 0
Views: 77
Reputation: 1430
I solve my problem...
Instead to save order_id
to the $_session
I have passed it with send link
<button type="submit" name="order" form="form-order" id="button-send" title="My order" onclick="send('http://myurl.com/data/send.php?order_id=<?php echo order_id ?>');"></button>
And simply retrieved it in my send.php with get
function and I get working all I need.
Thanks all for the help.
Upvotes: 0
Reputation: 1
It is possible to send order_id to the file before submit?
No.
Sending, as you seem to put it, means submitting.
Upvotes: 1