How do i pass form vaues to javascript window.open.

ساخت وبلاگ
I have a form on click on the button i call the "doWithMbg" method, and in calling the method i pass form values to it.

I have a callback inside the "doWithMbg" function and inside the callback i did a "window.open" like you can see in the code below.

Now My question is how do i pass this form values to the next page. If it were using PHP i would have done something like this:

window.open('sponsor-verify-payment?txref=<?php echo $reference; ?>&em=<?php echo $email; ?>, '_self');

but i want to use javascript and this is what i have done so far

<button type="button" onclick="doWithMbg(document.getElementById('cost').value,document.getElementById('email').value,docu ment.getElementById('reference').value)"> Send Now! </button>
</form>


function doWithMbg(cost,email,reference){
getpaidSetup({
customer_email: email,
amount: cost,
txref: reference,
country: 'NG',
custom_title: 'REACHOUT-CAMPAIGNS',
custom_logo: '',
onclose: function() {
window.open('index.php', '_self');
},
callback: function(response) {
window.open('sponsor-verify?txref=+document.write(reference)+&em='+document.write(email)+', '_self');
}
});

}
CodingForums...
ما را در سایت CodingForums دنبال می کنید

برچسب : نویسنده : codingforums بازدید : 231 تاريخ : چهارشنبه 11 ارديبهشت 1398 ساعت: 22:22