UWP applicationcontenturirules url rule added but not working for iframe - html

I am using UWP store app using typescript and winjs. As per requirement we need to load remote web page in our app and that page required some form parameter which are not possible to set with query string as size limitation. so we decided to use IFrame which allow to receive form post data. for this I have add the remote web page URI to the ApplicationContentUriRules section of the package manifest.
but getting me below error while performing post form action.
APPHOST9625: Unable to navigate to: 'https://www.mytestweb.com/'. An
iframe attempted to navigate to a URI that is not included in the
ApplicationContentUriRules for this app. Use a x-ms-webview element to
view the URI instead, or add the URI to the ApplicationContentUriRules
section of the package manifest so that the iframe can navigate to it.
(In Visual Studio, add this URI to the Content URIs tab of the
Manifest Designer.)
Is anything I am missing or wrong? I need help to resolve this.
below is my sample code,
<form id="my-form" action="https://www.mytestweb.com/operations" method='post' target="my-iframe">
<div class="col">
<div class="row">
<input type="hidden" name="token" value="largeTokenString" />
</div>
<div class="row">
<input type="hidden" name="transaction" value="serializedTransactionData" />
</div>
<div class="buttonContainer">
<button type="submit" data-bind="click: postFromData">Post</button>
</div>
</div>
</form>
<iframe id="my-iframe" name="my-iframe" src="about:blank"></iframe>
When I submit on from post button remote URL loads with form data, without from data my remote URL is not loaded.

I am able to resolve my issue. One of my team member question me, how you know your app refers updated app manifest. I don't know where I find this.
So I have uninstall my app from computer clear app memory from app data using app name search and delete. Create new app package using msbuild command and install new app, now my app able to load remote URL successfully in IFrame.

Related

How to add external link from Database in laravel?

In my Laravel project I have created a input field where facebook account link will be given as input. This input will store in the database. Then I create an object of that table and used the link in tag. i was expecting that this will take me to the given facebook account link. But it is creating a route like this /link. How can I solve this.
This code is for input field
<div class="form-group col-md-12">
<label for="name" class=" form-control-label">
Facebook ID
<span class="reqfield">*</span>
</label>
<input type="text" id="fb_link" placeholder="Facebook ID" class="form-control" name="fb_link" required value="{{$data->fb_link}}">
</div>
And this code is for Showing the link:
</li><li><span class="fa fa-play"></span>Facebook
The file is Here
Its the client browser that does this. Nothing to do with Laravel or blade
If a href does not start with a protocol then it is assumed to be local to the current site.
You need to check the link when it is given to you, and if it starts http:// ot https:// then leave it alone, otherwise add http:// to the url before you save it in the database.
Force the URL to lowercase before you check incase they gave HTTP:// or even hTTp://
It's because your URL is missing the PROTOCOL ( http, https, etc. )
You need to append a valid protocol with the URL before saving to the database or in your view.
Example, in your view:
</li><li><span class="fa fa-play"></span>Facebook
You can also use the Laravel's inbuild validation method to check if the
entered URL by the user is valid or not. Check https://laravel.com/docs/7.x/validation#rule-url

HTML form submit() (destination angular site) throws 'Cannot POST /' error

I have a simple html form in a coldfusion application. Here is the code:
<form id="form1" name="form1" method="post" action="myAngularApp/#/myapp/new">;
<input name="data" type="hidden" id="hiddenField" value="<cfoutput>#form.data#</cfoutput>" />
</form>
<script> document.form1.submit(); </script>
The Url in 'Action' points to a different server that hosts an angular app (running on nodejs). Also I use full path including http (removed above for brevity) in Url. When I click submit, it goes to the other site but shows 'Cannot POST /' message. If I access the same link directly in a new browser window, the page loads fine. If I replace POST with GET method, then the destination page loads but immediately redirects the user to login page for authentication and when user comes back, the data posted (available as querystring) is lost. Angular app is a hybrid app (Angular version 4.4 and 1.6; node version 9.x). How do I make POST work? I am not using express. Most of the links I found while searching online show express examples but I dont use express. Do I need to use ngRoute? Since it's a hybrid app, I am not sure whether to use angular-route (ngRoute) or angular-router. If the destination page loads directly in browser, why does not it load when redirected from the other server?

iOS 9 - Web Form Not Submitting When Photo Selected from Existing Library

I am creating a form in a web app that needs to upload an image file.
This should work whether you take a "new photo" or choose a file from your "existing library".
I am testing the form on iOS 9.1 and I can get it half-working.
If I take a NEW photo, then it works perfectly and advances to the success screen.
If I choose a photo from my existing library, then it does not work. It sort of appears like it's working, but then it just reloads the same page. The data never submits to the backend.
I'm using code I used with iOS 8 and if I recall, it worked properly.
This is what I have:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<form id="defaultForm" method="post" class="form-horizontal" action="/receipt-submit" enctype='multipart/form-data'>
<div class="form-group receiptContainer">
<div class='upload-photo' onclick="$('#receipt').click()">
<image src='/img/camera-icon.png' class='img-responsive' alt='' />Upload Your Receipt</div>
<div id="Ugly">
<input type="file" name="receipt" id="receipt" accept='image/*' />
</div>
</div>
<button type='submit' name="validateBtn" class="upload-photo submit" id="validateBtn">Submit</button>
</form>
I had to get fancy with the styling, which is why you see that div with an id = "ugly".
I would love to get this working with button new and existing images, but nothing I try seems to work.
Any help or ideas is appreciated.
Thanks in advance!
I had a similar issue which has plagued my users since IOS 9 came out. I FINALLY fixed it. Basically, the issue is that Safari Mobile drops the .jpg from the uploaded filename for .jpg media files. Screenshots and current Camera are .pngs, and they get uploaded with an extension, so they work. It's just images you take with the camera and save to the media roll ahead of time that don't have an extension at upload time. Since most server side back end systems check extensions to determine whether the file is an image and should be post-processed, it's most likely that on the server side you are receiving the file, but you are instantly discarding it because it has no extension. Since I couldn't test with a true IOS device against my local dev environment, and ergo, step through the server side code after being submitted by an actual IOS Device (not an emulator), I assumed the same thing, that the input was never getting posted.

Does Phonegap allow to make POST requests?

I'm working in an app with Phonegap. I did many GET requests for getting JSON files and they work nicely, but when I try to do the same but with a POST request, I have no callback and in the server I get error 400 (I don't even send anything to the server).
So I minimized my app and I included this in a plain HTML:
<form action="https://edge.suitepad.de:442/api/v1/8b17ec5acab7537b/orders/a4054d5fe4184431f55aca69cca9a7ef/purchase" method="post">
 <input type="hidden" name="order" value='{"currency":"eur","order_items":[{"id":265,"quantity":5}]}' />
 <input type="submit">
</form>
Does this work for you? Do you receive any callback having this form in an app with Phonegap?
Thank you.
Post requests work just fine from phonegap - the bad request error is something specific to your combination of data and server setup.
The html you show certainly won't fire a callback though - as soon as you click submit, it is loading a page from the server and the phonegap page containing the callback is gone.

Passing HTML form data in the URL on local machine (file://)

I'm building a small HTML/JS application for primary use on local machine (i.e. everything is accessed via file:// protocol, though maybe in the future it will be hosted on a server within intranet).
I'm trying to make a form with method="get" and action="target.html", in the hope that the browser will put form data in the URL (like, file://<path>/target.html?param1=aaa&param2=bbb). However, it's not happening (target.html opens fine, but no parameters is passed).
What am I doing wrong? Is it possible to use forms over file:// at all? I can always build the url manually (via JS), but being lazy I'd prefer the browser do it for me. ;)
Here is my sample form:
<form name='config' action="test_form.html" method="get" enctype="application/x-www-form-urlencoded">
<input type="text" name="param1">
<input type="text" name="param2">
<input type="submit" value="Go">
</form>
It might be some browser specific restriction. What browser are you using?
I tested this in Firefox 3.6.3 and Internet Explorer 8, and it works just fine.
Ok, that was stupid. The controls of my form are generated dynamically (via JS), and the generation function was setting ids for them, but not names. So, from the form's point of view, there was no parameters at all.
Thanks to Guffa for providing me a nudge in the right direction!