POST forms into Web AppBuilder

3571
3
06-29-2015 04:06 PM
HamishKingsbury1
Occasional Contributor

Hey Guys

I'm using the Dev SDK for Web AppBuilder to build an app. The client would like to submit a form contain a number of locations that need to be routed to. I'm at the point of getting the data from the first website into Web AppBuilder. I decided to go with the POST methods rather than GET to keep the url clean.

I made a very basic form (in the root dir of the app):

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Test Post to Webapp</title>
    </head>

    <body >
        <h1>Test Post to Webapp</h1>
        <form id="form" method="post" action="result.html">                    
            <label class="description" for="element_1">CRC 1 </label>
            <input id="element_1" name="element_1" class="element text medium" type="text" maxlength="255" value=""/> 
            </br>
            <label class="description" for="element_2">CRC 2 </label>
            <input id="element_2" name="element_2" class="element text medium" type="text" maxlength="255" value=""/>
            </br>  
            <input id="saveForm" type="submit" name="submit" value="Submit" />
        </form>    
    </body>
</html>

When I hit submit and result.html loads, it displays this error:

Cannot POST /webappbuilder/apps/4/form/result.html

I googled the problem and it seems others have had the issue with Node.js (which i believe I'm right in saying Web AppBuilder uses) but none that I've come across that are Web AppBuilder specific.

After some more playing i think it might be down to the Web AppBuilder server not parsing PHP properly? But i'm not 100% sure on this. If anyone is able to assist me with my problem that would be great.

Thanks

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Hamish,

   I have not attempted to use a separate html form and have it interact with WAB like you are attempting. You could just setup the fields you are wanting to fill in a widgets html template and not worry about a separate form.

0 Kudos
HamishKingsbury1
Occasional Contributor

They want that ability as well. Basically the first web page contains a whole host of algorithms and calculations that then output a few locations which are then required to have distances calculated. This first webpage interacts with their billing/finance system. Sometimes they need to use the map, sometimes they don't, sometimes they only need the map. They decided they wanted two separate applications that can be used interdependently of each other.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Hamish,

   I don't have any advice for developing your app using php and form posts while using Node JS. You may need to do the form portion of your development separately just on your web server and then your widget development and export your app to your web server to continue the integration development.

0 Kudos