[Pro] form query

Hi all,

I’m wanting to do something minorly (?) tricky with form items…

I want people to check some checkbox choices and then hit a SEND button. This send button will actually open a ‘completion’ form in a lightbox window…and will be prepopulated with the choices made in the previous step. they now just complete their name/company/email details and SUBMIT…which will send the form and confirm the sending in the lightbox window…which can then be manually closed.

So…passing form items to another form, I guess. Not sure how I do that or how I get it to pass them to a new form in a lightbox window!

It would look good and be very functional, but sounds tricky! Any ideas?

thanks
Hugh


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

This send button will actually open a ‘completion’ form in a lightbox window…and will be prepopulated with the choices made in the previous step. they now just complete their name/company/email details and SUBMIT….which will send the form and confirm the sending in the lightbox window…which can then be manually closed.

Why would you want to make the submitter jump through so many hoops, opening lightboxes and closing windows as they go.

This sounds like very bad UX and is likely to lead to unsubmitted forms.

Forms should be simple to fill and send.

My 2c

David


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

Hi David,

I don’t think the submitter would have to jump through a lot of hoops - just two stages.

The reason for not putting all the fields on one page is because that page is not really a form page…it’s an information page, and I don’t want to clutter it with form fields.

Hugh


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

it’s an information page, and I don’t want to clutter it with form fields.

Then make a new page for the form.

D


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

Sorry, that’s not how I want it to work! I am actually thinking here about what you call ‘UX’ (?) - and there’s some solid ‘UX’ in the method I’m describing.

So regardless of subjective ‘UX’ , which I’ll stand or fall by, I’m interested in the technicalities of achieving what I describe.

cheers
Hugh


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

UX - user experience

D


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

Just had a cursory try, and others might know of restrictions, but might the “ReadMore” action provide the functionality you want?

http://actionsforge.com/actions/readmore


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

Hugh,

I would do this using PHP. Capturing the detail then passing the results to the next page (or re-loading the same page) using POST or GET

It’s good for UX if you have a long form or different stages for a form (or shopping cart) that need a calculation on fields as you progress. Or pre-filling a form from an email link.

You’d need to start to dip your toe into that water of PHP or get someone to write that bit for you and help integrate it into Freeway

David Owen { Freeway Friendly Web hosting and Domains }

http://www.ineedwebhosting.co.uk | http://www.PrintlineAdvertising.co.uk

On 5 Feb 2015, at 17:06, hugh email@hidden wrote:

Hi all,

I’m wanting to do something minorly (?) tricky with form items…

I want people to check some checkbox choices and then hit a SEND button. This send button will actually open a ‘completion’ form in a lightbox window…and will be prepopulated with the choices made in the previous step. they now just complete their name/company/email details and SUBMIT…which will send the form and confirm the sending in the lightbox window…which can then be manually closed.

So…passing form items to another form, I guess. Not sure how I do that or how I get it to pass them to a new form in a lightbox window!

It would look good and be very functional, but sounds tricky! Any ideas?

thanks
Hugh


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

Thanks for the ‘read more’ tip, Simon - interesting little action I’d not noticed before; but I think as David says it might need some PHP trickery to do this (or JQuery maybe?)

I have read a couple of articles about this which seem to suggest it can be done using hidden fields or sessions. I can possibly even (at a stretch!) get my head around them, although both examples included MySQL involvement which I don’t need - I guess I could strip out that step.

I think my stalling point is how to pass the variables from stage 1 (ticked checkboxes) into a lightbox window for stage 2.

I suppose I could put the entire form in the lightbox window, although this isn’t quite as elegant as the UX I’m thinking of (because it would be necessary to replicate the text items/checkbox choices which are already on the main page)

Hugh


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

Passing form values from one page to another means you have to process the form submission from the first page on the second form page. You can see what your first form is actually sending by setting the form Action (in the Form Setup dialog) to point to Reflector

I recommend you look at this output before you go further, because naming checkboxes and giving them values that will pass through to your second form handler is non-intuitive, and a check box that is not checked is not even sent to you – I know that caught me out quite a few times.

Your first form page would be set up manually (no Action needed). Instead of pointing it at my Reflector, you would set its Action to the filename of the second form page. Before you do that, you would set the second form page itself to have its filename end in .php.

Next, you would create the “pass-through” fields as hidden form elements, using the Page / Form Setup dialog. This is probably the easiest way to make this work, since you would only need to do this small part by hand, and the rest of the form handling (on the second form) could be managed through an Action like Softpress’s Send Form or Tim Plumb’s PHP Feedback Form Action.

So here’s what you want to end up with when you’re done (in HTML) on the second form page:

<input type="hidden" name="foo" value="<?php if(isset($_REQUEST['foo'])) echo $_REQUEST['foo']; ?>">

(And here, I am using the traditional “foo” variable name to stand in for whatever_you_named_the_checkbox_in_your_first_form. You would have set this in the Inspector, in the third tab from the left, in the Name field. Nothing – no other field in the Freeway interface – will do in place of this choice. This is case-sensitive, and should begin with a letter a-z and not contain any spaces or punctuation besides the underscore.)

So to get Freeway to create this hidden variable, you would (on the second form page) open the Page / Form Setup dialog, and locate the Hidden Fields section of that dialog. Click New or Add (don’t have it open in front of me) and you should be able to edit two values: name and value. In the Name field, you want to enter whatever you called the checkbox in your first form (note: exactly the same, case and everything). In the Value field, you want to type the following, but substitute the actual name of your form field for ‘foo’. All quotation marks must be true “typewriter” quotes, not “curly” or smart quotes. Freeway won’t do this for you, but recent versions of Mac OS have begun to do it in lots of places you wouldn’t expect them to, so be aware.

<?php if(isset($_REQUEST['foo'])) echo $_REQUEST['foo']; ?>

Repeat these steps for the other check boxes. What you have done now is to make a single form (the second one) that you can process the way you are accustomed to in Freeway (with an Action) that includes fields from a previous form that submitted to it.

This has taken me longer to type out than it will for you to do the first time, and from then on, it may get simpler. If you are truly afraid of code, this is a very tiny way to get started working on that problem. (Note very carefully: if you expect to make any reasonable living at Web design, you have to work on this problem and master it. Your fear will be your undoing, as Yoda might have said, albeit with much stranger syntax than I can summon at this early hour.)

Walter


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

Walter,

I’m indebted to you for that long explanation - must have taken some time to type out - as you say, more time than it probably takes to actually ‘do’ it!!

I think I can work with that procedure and have a stab at it - maybe just start with one checkbox to get it working and then add some more (there will be about 20 eventually).

A couple of questions, though:

  1. “Your first form page would be set up manually (no Action needed). Instead of pointing it at my Reflector, you would set its Action to the filename of the second form page.” - yes ok, but this is the bit where I want that second form page to open in a lightbox window. How do I make that happen from the Freeway form action dialogue?

  2. In the second (lightbox) form I’d like to display the choices made in form 1 (the variables passed) and then have the name/address/email fields etc. I guess to display the checkbox info being passed I need some kind of ‘echo’ or ‘print’ statement…??

Hugh


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

On Feb 7, 2015, at 5:52 AM, hugh email@hidden wrote:

Walter,

I’m indebted to you for that long explanation - must have taken some time to type out - as you say, more time than it probably takes to actually ‘do’ it!!

I think I can work with that procedure and have a stab at it - maybe just start with one checkbox to get it working and then add some more (there will be about 20 eventually).

A couple of questions, though:

  1. “Your first form page would be set up manually (no Action needed). Instead of pointing it at my Reflector, you would set its Action to the filename of the second form page.” - yes ok, but this is the bit where I want that second form page to open in a lightbox window. How do I make that happen from the Freeway form action dialogue?

Page / Form Setup opens the dialog box governing any form on any page. So first, look at your second form page in Freeway, change the File name value from whatever.html (Freeway’s default filename extension) to whatever.php. This will have no effect on anything else in Freeway with one exception: you will no longer be able to preview the layout in Freeway or in a local browser – you’ll have to preview from your server, because WebKit (and thus Freeway and Safari) won’t treat a PHP page as if it was HTML.

Then on your first form page, you open up the Form Setup and paste the whatever.php filename into the Action field in that dialog. The Method should be set to POST.

  1. In the second (lightbox) form I’d like to display the choices made in form 1 (the variables passed) and then have the name/address/email fields etc. I guess to display the checkbox info being passed I need some kind of ‘echo’ or ‘print’ statement…??

So follow the directions I gave you to create the hidden form fields, and then you can copy the <?php if(isset($_REQUEST['foo'])) echo $_REQUEST['foo']; ?> statement (one per actual variable name) and paste it into a Markup Item in the middle of a run of HTML text in your layout. This will create a string of text with whatever value they chose from the first form, or nothing if they didn’t choose one of those options.

Walter

Hugh


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

Hi Walter,

Sounds great, thanks. But I still don’t see how I get that second form (whatever.php) to open in a floating lightbox window…? Sure, on the first page I’m adding whatever.php into the form action dialogue. And I’m sure that will open whatever.php. But it won’t open it in a floating lightbox window…will it?

I’ve worked with some lightbox scripts and often there a tag to add into my link like “rel=lightbox” or something. But that’s a normal link, whereas in the page form action it’s not a normal link.

So I’m wondering how to get whatever.php to open in a flaoting lightbox window?

cheers
Hugh


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

Oh, I missed that point. I don’t think you’re going to be able to make a form submission from a flat page open and populate a lightbox on that same page. You could simulate the look, by designing the second page with a floating “layer” to look like a lightbox, and put the second form in that lightbox. But to get a form to submit to the same page and appear in a lightbox on that second request is going to be a whole lot of work for very little benefit. When they submit that second form, where does it take them? What happens to the content of the first form “beneath” the lightbox?

Walter

On Feb 7, 2015, at 1:45 PM, hugh email@hidden wrote:

Hi Walter,

Sounds great, thanks. But I still don’t see how I get that second form (whatever.php) to open in a floating lightbox window…? Sure, on the first page I’m adding whatever.php into the form action dialogue. And I’m sure that will open whatever.php. But it won’t open it in a floating lightbox window…will it?

I’ve worked with some lightbox scripts and often there a tag to add into my link like “rel=lightbox” or something. But that’s a normal link, whereas in the page form action it’s not a normal link.

So I’m wondering how to get whatever.php to open in a flaoting lightbox window?

cheers
Hugh


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