It works perfectly redirecting you to an url, and passing the input’s values, now I’m building the same page with ionic, and I would like to have the same behavior opening my url with “cordova-plugin-inappbrowser” and also passing the parameters, is there any way to do that?
*I doesn’t matter what happens after the url is open, I just need to send the parameters and open the page.
If you have control over the page which the form is submitted to, you should setup an API for it and call it with HTTP. I think that would be the best approach, otherwise try this http://stackoverflow.com/a/41185803
I don’t have control over the page, that is the main problem, but I solved it whit that link you posted, however the page opens using target “_blank” but not with “_system” which would be perfect for me, any idea about why it doesn’t work?
Hi sunilrawat.
Did you manage to get yours working at all? I am trying to implement posting a from via InAppBrowser but no success.
Any help would be great.
if (appConfig.isDevice) {
console.log(‘Run in device’);
fields.surl = ‘’;
fields.Furl = ‘’;
openInAppBrowser(fields);
}
Then
var openInAppBrowser = function(fields) {
//Post all required paremeters to the payu
iabRef = window.open(‘payuBiz.html’, ‘_blank’, ‘location=no’);
iabRef.addEventListener(‘loadstart’, function() {});
iabRef.addEventListener(‘loadstop’, function(event) {//Handle response from payment gateway here
}
Thanks for your reply! Really appreciate your help.
Can you please give me some more clarification with this part of your code:
var openInAppBrowser = function(fields) {
//Post all required paremeters to the payu
iabRef = window.open(‘payuBiz.html’, ‘_blank’, ‘location=no’);
iabRef.addEventListener(‘loadstart’, function() {});
iabRef.addEventListener(‘loadstop’, function(event) {//Handle response from payment gateway here
}
How do I post all the req parameters to the url which I am posting to? (i.e. how does the ‘fields’ object get utilised in this function.
Also, in iabRef = window.open(‘payuBiz.html’, ‘_blank’, ‘location=no’); is the payuBiz.html your html which holds your form to be posted or is that supposed to be the url you are wanting to open?
My original hidden form which I am wanting to post looks like this: