The order of the fields in your processor script depends entirely on
their order in the source code of your page. If you laid out the form
by drawing form elements directly on the page, then it’s very easy for
these to be out of order in the source while still appearing on screen
as if they are in the order you expect. That’s because items drawn on
the page in Freeway are positioned absolutely, which puts each one of
them in a layer (and thus a world) or their own. These layers can be
in any order and still appear to position their contents in a
particular x/y coordinate on the page.
In order to sort this out (bad pun) you have a couple of options. The
one I would recommend most strongly is to draw a table on the page
with the table tool (set its borders and such to 0 so it will be
invisible, but will still do the thing you need it to do). Make it two
columns wide by as many rows as you have inputs. Cut each of your form
elements from the page and then double-click into one of the right
column cells and paste. Repeat until all of your form fields are
inside the table. Then do the same thing with the field label text,
except place those in the left column.
When you are done, you should have a single field in each row of your
table, with the apposite label next to it. I also like to set the
labels to align-right and the fields to align left – it’s a very easy-
to-read layout and makes the form easier to parse. If you do that, you
may want to add some right-padding to the label column so that the
labels don’t crash into the form fields. Resist the urge to add
another column to the table to accomplish the same thing.
The reason I recommend this is that it also gives you – for free –
better accessibility for visually-disabled visitors who are using some
form of assistive device like a screen reader to navigate your form.
By itself, a regular “vanilla” Freeway form layout does nothing to
bind the labels to the form elements they describe. This means that
someone hearing the page read aloud would have absolutely no clue what
each form field meant, and would be unable to fill it in.
The other option (much simpler, but less correct) is to click on the
disclosure triangle left of your page name in the Site panel, which
will show all the elements on the page. Click on each form element in
turn in your design view, and you will see its name “light up” in the
hierarchical list of elements in the Site pane. Move the first form
element to the top of the stack, then the next, and so forth. This
will set the order of your fields as they will appear to the form
handler. Your layout will (probably) not change at all visually, but
the order of elements will be set.
Walter
On Apr 27, 2010, at 11:33 AM, Clark Brown wrote:
I have created a new site for a local Museum which has 4 forms that
work fine except for when the forms are received the order sequence
is out. Instead of them following an A,B,C sequence they jump around
like F,K, J, etc. I checked and double checked my Inspector under
the Text Field option in Item Output Settings and they are all set
correctly, i.e. " A Date " “B Name” and so forth. I suspect it is
something to do with the script.
The site link is:
https://www.museumgreatplains.org/museumofthegreah.html
Below is the php script. Any ideas?
Thanks, Clark
<?php
// $mail_to and $mail_from must be set.
$mail_to = 'email@hidden'; // Who is the E-Mail
going to?
$mail_from = 'email@hidden'; // Where does the E-
Mail appear to be from?
// OPTIONAL SETTING
$redirect_url = 'http://museumgreatplains.org/
thankyoumembersh.html'; // Example: http://domain.com/thankyou.html
- must be a FULL URL.
############################
# DO NOT EDIT BELOW THIS #
############################
// Fail if _POST and _GET are empty. Nothing to process.
if(count($_POST) == 0 AND count($_GET) == 0):
echo 'This form handler does nothing if visited directly. You must
submit form data to this script.';
exit;
endif;
// Fail if $mail_to or $mail_from are not set.
if(empty($mail_to) OR empty($mail_from)):
echo 'You must edit this script and set the appropriate values for
$mail_to and $mail_from.';
exit;
endif;
// Set $fields to whichever method is being used.
$fields = (count($_POST) > 0 ) ? $_POST : $_GET;
$message_body = "Form Submission nn";
foreach ($fields as $field => $value):
switch(strtolower($field)):
case 'redirect':
$redirect = $value;
break;
case 'subject':
$subject = $value;
break;
endswitch;
if (strtolower($field) != 'redirect' AND strtolower($field) !=
'submit' AND strtolower($field) != 'subject'):
$message_body .= strtoupper($field) . ": " . $value . "rn";
endif;
endforeach;
// Set the redirect URL from the form (if set). $host_url is a
default action if $redirect isn't set
$redirect = (empty($redirect_url)) ? $redirect : $redirect_url;
$host_url = $_SERVER['HTTP_HOST'];
// Set the message subject based upon a subject field being set or
not.
$message_subject = (!empty($subject)) ? $subject : 'Message from '.
$_SERVER['HTTP_HOST'];
$headers = 'From: ' . $mail_from. "rn" .
'Reply-To: ' . $mail_from . "rn" .
'X-Mailer: PHP/' . phpversion();
// Remove potentially injected headers from the body
if (!mail($mail_to, $message_subject, $message_body, $headers)):
echo "Message Send Failed.";
endif;
if(empty($redirect)):
header("Location: http://{$host_url}");
else:
header("Location: {$redirect}");
endif;
?>
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