Black Friday Sale! Use promo code: DMXBF20 valid only for hours

DMXzone App Connect Support Product Page

Solved

form not working as soon as I add App Connect

Reported 30 Apr 2018 14:07:28
1
has this problem
30 Apr 2018 14:07:28 Bruce Wilkie posted:
Hi there

As soon as I add App Connect to my page, the form on the page stops working. Before, it would take me to another page but not any more.

I tried to post the code to show the difference here, but your WebKnight system won't let me do this.

Please can you help?

thanks
Bruce

Replies

Replied 30 Apr 2018 14:08:19
30 Apr 2018 14:08:19 Bruce Wilkie replied:
Hang on. I've figured outhow to add code here

So this works fine:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>

<form action="series-home.htm" method="get" name="form1" id="form1">
	<label for="seriesid">ID:</label>
	<select name="seriesid" id="seriesid">
		<option value="1" >1</option>
		<option value="2" >2</option>
	</select>
	<input type="submit" name="submit" id="submit" value="View">
</form>

</body>
</html>


But this doesn't:


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript" src="dmxAppConnect/dmxAppConnect.js"></script>
</head>

<body id="formtest" is="dmx-app">

<form action="series-home.htm" method="get" name="form1" id="form1">
	<label for="seriesid">ID:</label>
	<select name="seriesid" id="seriesid">
		<option value="1" >1</option>
		<option value="2" >2</option>
	</select>
	<input type="submit" name="submit" id="submit" value="View">
</form>

</body>
</html>


Replied 01 May 2018 06:17:10
01 May 2018 06:17:10 Teodor Kuduschiev replied:
Hello Bruce,
What exactly should your form do, and what are you doing/trying to do with app connect with that form?
Replied 01 May 2018 13:51:31
01 May 2018 13:51:31 Bruce Wilkie replied:
Hi Teodor

I'm using the form to make a selection from a select tag, and then pass the value on to a details page.

App connect is used to populate the page with data from a database. Once I have the form working I'll rebuild the rest of the page where App connect is used with 6 Server Connect queries, putting data from different data tables on different parts of the page.
Replied 01 May 2018 14:11:55
01 May 2018 14:11:55 Teodor Kuduschiev replied:
Hello Bruce,
App Connect handles the form submission itself, when inserted on the page. You cannot use your form to just post some stuff to some other page when using app connect, like you do this on pages with no app connect inserted.
Replied 01 May 2018 14:41:19
01 May 2018 14:41:19 Bruce Wilkie replied:
OK, so from what you're saying, App connect disables the action attribute of all forms when it's added to the page.

With that in mind, how do I use a form when App Connect is installed on a page to pass a value to another page?

Do I use some alternative to action="detail-page.htm" something like dmx-action="detail-page.htm" ?
Replied 02 May 2018 10:15:17
02 May 2018 10:15:17 Teodor Kuduschiev replied:
App connect uses ajax to submit the form. When using app connect, you do not need to submit the form results to another page. you could do all on the same page.
Usually you use app connect on a site built with app connect. I do not understand the idea behind using app connect on one page, and not on another? You could just store your form values into session/local storage/cookie vars, so that they are available on the next page, just like explained here: www.dmxzone.com/go/32875/working-with-sessions
Replied 02 May 2018 10:49:09
02 May 2018 10:49:09 Bruce Wilkie replied:
Thanks Teodor

I'm wanting to render results on a separate page, with a unique url that I can link to from elsewhere on the internet. The way I want to do this is with a query string. And in my own website I'm wanting to set up a quick jump menu using a select form field. But I can't do this with App Connect on the page as it disables the form submit.

Could you let me know how I submit a form with App Connect on it?

thanks
Replied 02 May 2018 11:25:20
02 May 2018 11:25:20 Teodor Kuduschiev replied:
Hi Bruce,
I got your idea now.
The issue seems to be caused by the id of the submit button which is "submit".

Please just change its name and id to something else, and you should be able to post with app connect like that.
However, this will be improved in today's update of App Connect, so that you will be able to use "submit" as an ID.
Replied 17 May 2018 14:11:07
17 May 2018 14:11:07 Bruce Wilkie replied:
Thanks Teodor

Changed the name and id and it's working just fine now

Bruce

Reply to this topic