Form Submit button/graphic + Spawn new window

Hi everyone,

Instead of having an error/success page for my form,
I want a popup (of a specific size) centered in the middle of my screen that appears after the (graphic) submit button is clicked that says:

"Thank you! A confirmation email was sent to the email address submitted. If the email is not in your inbox, please check your junk/spam folders.

If you have not recieved the email, you might have spelled your email address incorrectly. If you believe there is a problem with this form, please contact info (at) carolinagreeks.com"

I want that popup to appear when my graphic submit button is clicked.

I tried disabling the “submit” checkbox in the inspector pallete for the graphic item, and the spawn new window action works correctly.

However i can’t get the spawn new window action to work when the “submit” checkbox is checked for the graphic item.

Is what i’m trying to accomplish possible using this method? another method that might work?

I’m using Freeway 5.1.3 PRO

-Kosta X


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Is there a particular reason you don’t like Error/Success pages - they seem the easiest way to tell your users if they have done it right or not.

If you want to keep the user on that page you may be better using a form that posts back to itself and then displays the text that you want.

See Walter’s answer to this thread http://freewaytalk.net/thread/view/48207

This sort of thing might be what you are looking for.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You only want this to happen if the form was successful, right? If there were errors on the form that would keep it from submitting, you would need to handle those separately.

The post-back pattern is probably your best solution here. If you really want to keep someone on your page, then you could take it a step further by posting the form using an Ajax request (i.e.: without a page load) and then if the form is successful, update the host page using JavaScript sent back from the server. For an example of this, I give you the Web version of this list: http://freewaytalk.net

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

thanks for the rapid response guys,

DeltaDave:

I disklike success/error pages simply because I don’t want the users to navigate away from the current page they are viewing.

waltd:

the forms i have created are always “successful” because anything you enter validates.

the only time where the forms might be “unsuccessful” is if the user enters their email address incorrectly - they won’t recieve the confirmation email.

Or in a rare situation - the form script gets messed up somehow.

I want the “spawn new window” action to happen whenever you click the graphic submit button.

The page load thing that you are referring to (when i click the submit button) seems to be the issue.

I have no knowledge of an “Ajax request” or “post-back patterns”. Are there any threads here or elsewhere that covers these topics in depth?

once again,
thank you for your time guys!

-Kosta X


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you used PHP easiForm Actions for this you could set the action to reload the page on success rather than load a success page, then if you added a markup item and placed the following code in it, the user would be alerted to the success:

<?php
if ($easiMail_success) {
echo 'Your Form has been sent.......';
}
?>

you can change the text that is echoed out to what you want, also if you added a little more such as the email name set into an f array the email address would be cleared at the same time, you can even do this with the other form element names to do the same. This would need to go above the form element items to clear the field values.:

<?php
if ($easiMail_success) {
echo 'Your Form has been sent.......';
$f['email'] = '';
}
?>

If you place a space before and after the markup item and then select the spaced and the markup item you can then set a style to the output text to make it bold red for example, if you need any help on this just drop me a line.

BTW, there is a small charge for the PHP easiForm Actions but you can set it up and test before you buy.

Tutorial link:
http://www.easibase.com/freeway/freeway_form.php

The above tutorial does not show you how to do what you want to do, just how to use PHP easiForm actions for your form, but it may be of use to set the form up as it would generally be used, then when you get it working make the simple changes you need to function as you need.

HTH


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes. In order to send data from the browser to the server, the page
has to reload. It doesn’t have to navigate to a different page, but it
does have to submit the current form contents to the server, and the
server has to respond with a new page (the same or different) and the
browser has to load that new page.

This is the normal order of things.

Ajax (Asynchronous JavaScript and XML, as coined by Jesse James
Garrett at Adaptive Path) is a way to circumvent the normal order of
things, by using an out-of-band communication system developed by
Microsoft (I know, I was shocked too) and subsequently taken up by all
the major browser manufacturers.

Basically, it uses JavaScript to initiate a request without changing
the current contents of the page. The script listens for a response
from the server, and if one comes that it understands, the script then
modifies a part of the page – without forcing a refresh. This is what
happens on the Web forum view of this mailing list. Every time you
submit a message, the form submit button disappears, a little
“spinner” appears, and if everything goes well, a green banner appears
telling you that your message was posted. All without a “real” page
reload.

I can tell you more if you like, it’s endlessly fascinating stuff.

Walter

On Mar 4, 2009, at 2:06 PM, kosta x wrote:

The page load thing that you are referring to (when i click the
submit button) seems to be the issue.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s an example you can pick apart without too much pain:

http://scripty.walterdavisstudio.com/ajaxform/

The index.html is an empty shell, if you turn off JavaScript, you can
see that. The form is just a fragment of a form, created out of a
spare page using my TemplateHelper Action.

http://scripty.walterdavisstudio.com/ajaxform/_form.html

When the index loads, it inserts the form into the page, then sets a
listener function waiting for the form to be submitted. When it is,
the submit method is hijacked, and the form is sent through Ajax.

The only part you can’t see is the PHP handler, so that’s pastied here:

http://pastie.org/407677

All it does is reflect back whatever you entered, wait three seconds,
then reset the form to the beginning.

Walter

On Mar 4, 2009, at 4:23 PM, Walter Lee Davis wrote:

Basically, it uses JavaScript to initiate a request without changing
the current contents of the page. The script listens for a response
from the server, and if one comes that it understands, the script
then modifies a part of the page – without forcing a refresh.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

thanks for the responses everyone,

As for now i will upload the form without any feedback from the submit button.

Once i comprehend this great info, and get my form working the way I want, I’ll post back an update.

thanks!

-Kosta X


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

OK, so I’ve comprehended all of this info about AJAX, and waltd’s example is exactly what I’m after.

I’m currently using “Forms to Go” to create my .php scripts.
Is there a similar program for creating these AJAX forms with a tutorial anywhere?

I’m assuming the Template Helper action might be the answer, but am having trouble finding tutorial info about that action in regards to forms.

Also note, I’m hosting my website on a Linux server.

any pointers?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One of the bedrock rules of Ajax forms (that’s the capitalization, by
the way) is that you first get the form working the normal way, and
make sure that it all works without any JavaScript running in the
browser. Then you tart it up with cool-o effects.

So if you have a working form somewhere, and it does everything you
want it to, then you will start enhancing it.

If you can post an example of the PHP that FTG writes using Pastie.org
or another “clip-bin” service, I will help you take that next step.

Basically, the additions you need to make are as follows: Add
Prototype to your form page head. Make sure your form has an ID (use
Form Setup / Extended for this). Add a lump of JavaScript code to the
head of your page to hijack the form. Add a lump of PHP code to your
FTG processor to parse out if the request came through Ajax or not.
Modify your response pages to also recognize if they are loading
through Ajax or not.

Most of these additions are behind the scenes, and they are important
because when you do an Ajax form, you can’t ever return an entire page
– only a snippet of HTML called a page fragment or partial. Otherwise
you would be stuffing one page into another, which is a decent way to
crash a browser.

Walter

On Mar 13, 2009, at 7:45 AM, kosta x wrote:

OK, so I’ve comprehended all of this info about AJAX, and waltd’s
example is exactly what I’m after.

I’m currently using “Forms to Go” to create my .php scripts.
Is there a similar program for creating these AJAX forms with a
tutorial anywhere?

I’m assuming the Template Helper action might be the answer, but am
having trouble finding tutorial info about that action in regards to
forms.

Also note, I’m hosting my website on a Linux server.

any pointers?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options