Skip to main content
Inspiring
November 25, 2006
Question

WebAssist trigger "Any Form Post" not functioning?

  • November 25, 2006
  • 5 replies
  • 383 views
Not a peep from WebAssist tech support for three days now, despite a few
e-mails and a phone message, so I thought I'd ask in here.

I am using the WebAssist eCart software and have the "Store Cart Details in
Database" behaviour on my checkout page which I want to be triggered when
the user clicks either of the three checkout buttons (Protx, PayPal and
Invoice options for payment) on the page. Each of the buttons is within
it's own form.

I have selected "any form post" as the trigger for the behaviour, but it is
being triggered when the page loads, not when a form is submitted.

Is there something wrong with this bit, which appears to be the trigger in
the INSERT section of the code:

<%' WA eCart Store Cart Details in Db
if (Request.ServerVariables("Request_Method") = "POST") then

If anyone has experienced this, or can perhaps suggest what might be wrong,
I'd really appreciate it. Here's hoping WebAssist will eventually get back
to me, but if anyone can help in the meantime, it would be much appreciated.
Thanks.

Regards
Nath.


This topic has been closed for replies.

5 replies

Inspiring
December 11, 2006
Hello Nath,

Let me start by apologizing for the fact that nobody from WebAssist has
been back in contact with you. If you would like to contact me at the
following e-mail address I will be happy to look into this for you.

Email: mfletcher@webassist.com

Regards,
Mark



tradmusic.com wrote:
> Not a peep from WebAssist tech support for three days now, despite a few
> e-mails and a phone message, so I thought I'd ask in here.
>
> I am using the WebAssist eCart software and have the "Store Cart Details in
> Database" behaviour on my checkout page which I want to be triggered when
> the user clicks either of the three checkout buttons (Protx, PayPal and
> Invoice options for payment) on the page. Each of the buttons is within
> it's own form.
>
> I have selected "any form post" as the trigger for the behaviour, but it is
> being triggered when the page loads, not when a form is submitted.
>
> Is there something wrong with this bit, which appears to be the trigger in
> the INSERT section of the code:
>
> <%' WA eCart Store Cart Details in Db
> if (Request.ServerVariables("Request_Method") = "POST") then
>
> If anyone has experienced this, or can perhaps suggest what might be wrong,
> I'd really appreciate it. Here's hoping WebAssist will eventually get back
> to me, but if anyone can help in the meantime, it would be much appreciated.
> Thanks.
>
> Regards
> Nath.
>
>
Inspiring
November 25, 2006
On Sat, 25 Nov 2006 15:29:14 -0000, "tradmusic.com"
<sales@NOSHPAMtradmusic.com> wrote:

>I am using the WebAssist eCart software and have the "Store Cart Details in
>Database" behaviour on my checkout page which I want to be triggered when
>the user clicks either of the three checkout buttons (Protx, PayPal and
>Invoice options for payment) on the page. Each of the buttons is within
>it's own form.
>
>I have selected "any form post" as the trigger for the behaviour, but it is
>being triggered when the page loads, not when a form is submitted.

I don't know any ASP but in PHP, with multiple forms each having a
button:

<input type="submit" name="Submit" value="Submit">

then this works:

<?php

if ( isset($_POST['Submit']) && $_POST['Submit'] == 'Submit' ) {
// processing code here
}

?>

Just convert to appropriate ASP terminology.
--
Steve
steve at flyingtigerwebdesign dot com
Inspiring
November 25, 2006
I've also tried this:
<%' WA eCart Store Cart Details in Db
if ((Request.ServerVariables("Request_Method") = "POST") AND
(inStr(Unescape(cStr(Request.ServerVariables("HTTP_REFERER"))),Unescape(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME")))
> 0)) then

This too, whilst solving the issue of the data being saved "on page load",
doesn't save the data when one, of the three, form submit buttons are
pressed.

Saving to database based on the form submission from the previous page
really does seem nuts to me because what if a customer changes their mind?
It won't matter because their details have already been, needlessly, saved
to database.

Nightmare.

Regards
Nath.


"danilocelic AdobeCommunityExpert" <danilo@shimmerphase.com> wrote in
message news:ek9qm5$h28$1@forums.macromedia.com...
> tradmusic.com wrote:
>> Not a peep from WebAssist tech support for three days now, despite a few
>> e-mails and a phone message, so I thought I'd ask in here.
>
> Given the long holiday weekend in the US, I'd expect that they won't be in
> the office until Monday.
>
>> I have selected "any form post" as the trigger for the behaviour, but it
>> is being triggered when the page loads, not when a form is submitted.
>>
>> Is there something wrong with this bit, which appears to be the trigger
>> in the INSERT section of the code:
>>
>> <%' WA eCart Store Cart Details in Db
>> if (Request.ServerVariables("Request_Method") = "POST") then
>
> The code you are showing will not "trigger" or run unless the page is
> getting accessed via a form post, and will not run simply "on page load",
> so there is likely somethign else going on with the page. You can test
> that out by adding the following code to an empty page:
>
> <%
> Response.Write(Request.ServerVariables("Request_Method"))
> %><br />
> <%
> if (Request.ServerVariables("Request_Method") = "POST") then
> Response.Write("posted")
> End if
> %>
>
> The first block of code will write out the type of request and the second
> will only write out anything when there is a form post to the page.
>
> If you get to the page in question from some other page that performs a
> post, such as clicking of a add to cart button on an item's page, then
> that is why you are seeing that block of code run. If you need it to run
> from the click of a particular named button, then make sure to select that
> named button in the trigger list.
>
>
>
> --
> Danilo Celic
> | Extending Knowledge Daily : http://CommunityMX.com/
> | Adobe Community Expert


Inspiring
November 25, 2006
Hi,

I originally contacted them on Thursday. Bit disappointing really.

Yes, the page in question, the checkout page (final page prior to jumping
out to the payment provider), is arrived at via a form post. Are you
suggesting that the "any form post" trigger on the checkout page is being
triggered by a form submission on the previous page?

I find that slightly odd, however if that is the way this software works
then so be it. I guess it is in the interpretation of the phrase "any form
post". If I set up a trigger to run on "any form post" on a page, then I'd
expect it to only be triggered when the form post occured ON that page, not
a previous page.

I have three different form buttons on the checkout page so I gave them all
the same name (checkoutbtn) and have tried this:

<%' WA eCart Store Cart Details in Db
if (cStr(Request.Form("checkoutbtn.x")) <> "") then

Problem is, the details aren't being stored when "checkoutbtn" is clicked,
although this IS preventing them being stored when the page loads (my
previous problem). Out of the frying pan!

Can I name all three submit buttons the same, or would I need to name them
seperately and then add in some kind of "OR" command to this:
<%' WA eCart Store Cart Details in Db
if (cStr(Request.Form("checkoutbtn.x")) <> "") then

<%' WA eCart Store Cart Details in Db
if (cStr(Request.Form("checkoutbtn1.x")) <> "") OR if
(cStr(Request.Form("checkoutbtn2.x")) <> "") OR if
(cStr(Request.Form("checkoutbtn3.x")) <> "") then

I know that's not right, but if I use "Else", won't I have to replicate my
insert to database code for each button option?

Hope someone can help.
Regards
nath.

"danilocelic AdobeCommunityExpert" <danilo@shimmerphase.com> wrote in
message news:ek9qm5$h28$1@forums.macromedia.com...
> tradmusic.com wrote:
>> Not a peep from WebAssist tech support for three days now, despite a few
>> e-mails and a phone message, so I thought I'd ask in here.
>
> Given the long holiday weekend in the US, I'd expect that they won't be in
> the office until Monday.
>
>> I have selected "any form post" as the trigger for the behaviour, but it
>> is being triggered when the page loads, not when a form is submitted.
>>
>> Is there something wrong with this bit, which appears to be the trigger
>> in the INSERT section of the code:
>>
>> <%' WA eCart Store Cart Details in Db
>> if (Request.ServerVariables("Request_Method") = "POST") then
>
> The code you are showing will not "trigger" or run unless the page is
> getting accessed via a form post, and will not run simply "on page load",
> so there is likely somethign else going on with the page. You can test
> that out by adding the following code to an empty page:
>
> <%
> Response.Write(Request.ServerVariables("Request_Method"))
> %><br />
> <%
> if (Request.ServerVariables("Request_Method") = "POST") then
> Response.Write("posted")
> End if
> %>
>
> The first block of code will write out the type of request and the second
> will only write out anything when there is a form post to the page.
>
> If you get to the page in question from some other page that performs a
> post, such as clicking of a add to cart button on an item's page, then
> that is why you are seeing that block of code run. If you need it to run
> from the click of a particular named button, then make sure to select that
> named button in the trigger list.
>
>
>
> --
> Danilo Celic
> | Extending Knowledge Daily : http://CommunityMX.com/
> | Adobe Community Expert


Inspiring
November 25, 2006
tradmusic.com wrote:
> Not a peep from WebAssist tech support for three days now, despite a few
> e-mails and a phone message, so I thought I'd ask in here.

Given the long holiday weekend in the US, I'd expect that they won't be in the office until Monday.

> I have selected "any form post" as the trigger for the behaviour, but it is
> being triggered when the page loads, not when a form is submitted.
>
> Is there something wrong with this bit, which appears to be the trigger in
> the INSERT section of the code:
>
> <%' WA eCart Store Cart Details in Db
> if (Request.ServerVariables("Request_Method") = "POST") then

The code you are showing will not "trigger" or run unless the page is getting accessed via a form post, and will not run simply "on page load", so there is likely somethign else going on with the page. You can test that out by adding the following code to an empty page:

<%
Response.Write(Request.ServerVariables("Request_Method"))
%><br />
<%
if (Request.ServerVariables("Request_Method") = "POST") then
Response.Write("posted")
End if
%>

The first block of code will write out the type of request and the second will only write out anything when there is a form post to the page.

If you get to the page in question from some other page that performs a post, such as clicking of a add to cart button on an item's page, then that is why you are seeing that block of code run. If you need it to run from the click of a particular named button, then make sure to select that named button in the trigger list.



--
Danilo Celic
| Extending Knowledge Daily : http://CommunityMX.com/
| Adobe Community Expert