Button transfers selection data

Is there a way that i can apply some attributes to a button so that if a user clicks it, data is transferred to a form?

Let me explain. I have a series if enquiry buttons and I would like it if when s client clicked on the ‘February’ button that when they’re taken to the enquiry firm, an area show what they have enquirer about. So they don’t have to enter it again.

I suspects it’s a bit if php wizardry.


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

Can you show us the pages with the button(s) on and the page with the enquiry form on it.

David


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

Book now button is here:
http://www.newyoubootcamp.com/austria.html

Here is the enquiry:
http://www.newyoubootcamp.com/contact-us.html

I would like the date info to be taken to the form. The form is actually going to change today so don’t take too much notice of the content.

Nathan Garner
Senior Designer

RLA
http://www.rla.co.uk
(Part of The Mission Group)

Sent from my iPhone

On 14 Jan 2012, at 23:41, “DeltaDave” email@hidden wrote:

Can you show us the pages with the button(s) on and the page with the enquiry form on it.

David


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

Yes. You can do this in PHP.

Without going into code you can do this either from a basic link like this otherpage.php?product=thingamybobs

Then on the other page retrieve the variable “product” variable and print it’s value “thingamybobs” inside the other page e.g. Inside a web form. This method shows the variable in the URL on the destination page which you’ve probably seen before.

The other way is to send the value inside a form which post the values hidden to the destination page again where you can the print it on the page.

Of course you can manipulate this data like add up shopping carts etc. I would recommend its worth the time looking into PHP as a whole new world starts to open up.

David

On 14 Jan 2012, at 23:05, “BigG” email@hidden wrote:

Is there a way that i can apply some attributes to a button so that if a user clicks it, data is transferred to a form


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

I would love to delve further into php.

Any good starting points? Especially with this scenario, as I’m supposed to get it live later today.

Thanks
Nathan


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

OK, I have that working which is great.

If a user goes to the contact page WITHOUT clicking the enquire button, I obviously don’t want the ‘You selected: xxx’ field in there - is there a piece of code to add to it to hide it unless coming from the ‘enquire’ button?

Thanks
Nathan


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

Learning PHP (enough to be dangerous) takes a few weeks, not hours. I recommend you start with PHP and MySQL Web Development by Luke Welling and Laura Thomson. It’s about 2" thick, and starts from zero and takes you quite a way up the learning curve in carefully metered steps. It’s the book I wish I had read first. Would have saved a lot of bruises trying to make it up that first step in the book I did use.

Walter

On Jan 16, 2012, at 3:15 AM, BigG wrote:

I would love to delve further into php.

Any good starting points? Especially with this scenario, as I’m supposed to get it live later today.

Thanks
Nathan


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

If you followed David’s suggestion and have product=thingamabob in your URL (when they have pressed the enquire button) then you can test for that variable and use it to hide/show the picker. The one thing you have to be careful of at this point is to have the layout close up the hole around the missing picker. This means either a drawn table holding your form elements, or a full-on inline layout, with nested elements, so that if the field is missing, everything just scoots up to hide the fact.

Here’s a way to do this based on the assumption that you are using a table, and that you have followed the pattern of having two columns in that table, with labels in the left column and form fields in the right. (This is Best Practices for Freeway anyway, as it works around the lack of proper form labels.)

Click in one of the cells of the table within the row containing your picker. In the Inspector, locate the Row Attributes area. Click on the Markup button, and you’ll see something very similar to the Page / HTML Markup dialog, with options to add code outside of the TR or inside the TR. Choose Before TR, and enter something like this (adjusted for your actual variable name):

<?php if(isset($_GET['product'])) { ?>

Now switch to the After TR editor and enter the other half of the code:

<?php } ?>

That’s it. Now if the variable is present in the browser’s querystring (the part after the ? in the URL) this entire row will appear. If the variable is not there, the entire row will be gone. Everything below that will shrink up to fit neatly below the preceding row and nobody will be the wiser. Naturally, change the name of the variable to match whatever you’re actually using.

Walter

On Jan 16, 2012, at 9:24 AM, BigG wrote:

OK, I have that working which is great.

If a user goes to the contact page WITHOUT clicking the enquire button, I obviously don’t want the ‘You selected: xxx’ field in there - is there a piece of code to add to it to hide it unless coming from the ‘enquire’ button?

Thanks
Nathan


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 Nathan,
You could get the PHP to add a style to the element so that it doesn’t display on the page (display:none) although when the final email is received it may not make sense without the camp location and dates.

Although more work I’d suggest adding two sets of drop down menus to the contact us page; one which contains all of the camp locations and another with the dates. If the user clicks on an enquiry button you can use PHP to auto select the correct location and dates in the form. When the user comes to the form directly they can set the fields manually. This also gives the user the chance to change the date or location directly in the form without having to step back to the correct boot camp page just to press the enquire button again.
Regards,
Tim.

On 16 Jan 2012, at 14:24, BigG wrote:

If a user goes to the contact page WITHOUT clicking the enquire button, I obviously don’t want the ‘You selected: xxx’ field in there - is there a piece of code to add to it to hide it unless coming from the ‘enquire’ button?

FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


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

Hi Walter

It doesn’t seem to be working for me.

I click the enquire button in the middle of this page:
http://www.newyoubootcamp.com/portugal.html

To goto the contact page.
http://www.newyoubootcamp.com/contact-us.php

But nothing is in the field at the top of the form.

Nathan


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

Tried a few things - it’s not working for me for some reason.

When I click enquiries, I can see the text that’s been pulled in, but that’s not being sent with the other form items.

Nathan


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

What did you add as the value of that field in the contact form? If you put anything along the lines of

<?php if ( isset($_GET['dates']) ) echo $_GET['dates']; ?>

…then you should see the data from your querystring pre-entered for you. Without adding that PHP to your form element, it’s not going to automatically pre-fill.

Walter

On Jan 18, 2012, at 3:48 AM, BigG wrote:

Hi Walter

It doesn’t seem to be working for me.

I click the enquire button in the middle of this page:
http://www.newyoubootcamp.com/portugal.html

To goto the contact page.
http://www.newyoubootcamp.com/contact-us.php

But nothing is in the field at the top of the form.

Nathan


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

That is in so it’s working ok, but that text doesn’t get sent with the form.

Nathan


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

You need to either add a hidden field with exactly the same PHP code in it, or you need to change that HTML box where you’re displaying the selected enquiry to a form element.

Walter

On Jan 18, 2012, at 10:30 AM, BigG wrote:

Hi Walter

That is in so it’s working ok, but that text doesn’t get sent with the form.

Nathan


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

OK, so how would you add this markup to a form element?

<?php if ( isset($_GET['dates']) ) echo $_GET['dates']; ?>

In extended?

Nathan


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

No, that part just goes in the Value field, either in the Form Setup (for a hidden field) or the Inspector’s third tab from the left (for a normal text input).

Walter

On Jan 18, 2012, at 10:49 AM, BigG wrote:

OK, so how would you add this markup to a form element?

<?php if ( isset($_GET['dates']) ) echo $_GET['dates']; ?>

In extended?

Nathan


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

Doh… of course thank you Walter.

Nathan


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

…how do I hide the form element if it’s not populated - does that take a bit more work?

Nathan


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

Sure. Look back a few messages, I pointed out how to do that if you had laid out your form in a table. Be sure to substitute your actual name for the variable for whatever I put in there.

Walter

On Jan 18, 2012, at 12:47 PM, BigG wrote:

…how do I hide the form element if it’s not populated - does that take a bit more work?

Nathan


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

Still getting stumped by this.

  1. I have my form in a table.

  2. The first row in the table contains a form element. In the value field in the inspector I have:

<?php if ( isset($_GET['dates']) ) echo $_GET['dates']; ?>
  1. When I click on the cell that contains this form element and goto the inspector, in the before TR:
<?php if(isset($_GET['dates'])) { ?>

after TR:

<?php } ?>
  1. My enquire button is sending the variable ‘dates’ and when clicked, correctly populates the form element. But when you visit the page without clicking enquire, the form element and row are still there.

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