PHP Reply Form - autofill & "standards" naming for fields

Hi all techies,

First a question: are there “standard” naming conventions for field names in
reply forms? I know in Tim’s “PHP Feedback Form” there are field names that
have special status"

I’ve created a reply form here:

http://www.farasuto.org/Help/keepmeinformed.php

When I fill it in I get random parts of my personal details scattered
throughout the form. I have noticed when filling in some web forms, my
details are recorded correctly in the fields and other times even to the
extent that completely random information is inserted. I think I have sorted
this, I was naming the fields in the Inspector, I was naming the “Text
Field” in the “Item general settings” tab and forgot to go to the “Item
output settings” tab and name them correctly. Brain to keyboard link
broken!!

Second question: is there code I can put somewhere to stop the auto fill
function altogether?

Third question [for Tim I think]: can there be a “captcha” function added to
the “PHP Feedback Form” to stop the auto filling of these forms? I seem to
remember a “simple” math challenge-question being suggested?

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


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

You could add this with JavaScript. Paste this into the Page / HTML
Markup dialog, in the Before /BODY section:

<script type="text/javascript">
document.forms[0].autocomplete = 'off';
</script>

If that isn’t specific enough to do the trick, you can also use a loop
to go through all elements, test if they are text or password fields
and turn them off, but that’s more work. See if this works first.

Walter

On Mar 14, 2009, at 7:53 AM, Peter Tucker wrote:

Second question: is there code I can put somewhere to stop the auto
fill
function altogether?


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

on 14/03/2009 13:32, Walter Lee Davis at email@hidden wrote:

You could add this with JavaScript. Paste this into the Page / HTML
Markup dialog, in the Before /BODY section:

<script type="text/javascript">
document.forms[0].autocomplete = 'off';
</script>

If that isn’t specific enough to do the trick, you can also use a loop
to go through all elements, test if they are text or password fields
and turn them off, but that’s more work. See if this works first.

Thanks Walter.

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


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

Hi Peter,
As far as i know there are no starndards in naming form fields although a lot of
English language sites do tend to use the same names for common elements like
name, address, email etc. I’ve seen auto-fill features in browsers get confused
in the past when an email address is simply called address and the browser
incorrectly populates the user’s postal address. eally the naming is up to you.
The PHP Feedback Form code doesn’t care what order the submitted data is fed
into the code as it is all processed on a first come, first served basis. If
you make sure the form is in set out in the order tou ant the data processed
you should see the email data also set out in this order.
As Walter mentions you can extend the form items with an autocomplete attribute;

I’ve looked into putting a simple captcha into the action but haven’t found the
time as yet. I was thinking about Recaptcha (http://recaptcha.net/). One simple
solution that may work is adding a standard input field to the form that is
hidden from the user using CSS (not a standard hidden input but a regular
input). Obviously a regular user won’t see the input and will leave the field
blank. Automated scripts, on the other hand, will ignore the CSS and hapily add
data to the field. It is then very simple for the PHP script to dump the
feedback request if this field contains any data.
What do people think? Does this sound like a credible solution?
Adding a random math question to the form would mean that the page would have to
be PHP enabled which isn’t an issue, but currently the action keeps all of the
PHP awat from the rest of the HTML site. No file extension changes to forget
about, just attach the action, set the options and publish.
Regards,
Tim.

Quoting Peter Tucker email@hidden:

Hi all techies,

First a question: are there “standard” naming conventions for field names in
reply forms? I know in Tim’s “PHP Feedback Form” there are field names that
have special status"

I’ve created a reply form here:

http://www.farasuto.org/Help/keepmeinformed.php

When I fill it in I get random parts of my personal details scattered
throughout the form. I have noticed when filling in some web forms, my
details are recorded correctly in the fields and other times even to the
extent that completely random information is inserted. I think I have sorted
this, I was naming the fields in the Inspector, I was naming the “Text
Field” in the “Item general settings” tab and forgot to go to the “Item
output settings” tab and name them correctly. Brain to keyboard link
broken!!

Second question: is there code I can put somewhere to stop the auto fill
function altogether?

Third question [for Tim I think]: can there be a “captcha” function added to
the “PHP Feedback Form” to stop the auto filling of these forms? I seem to
remember a “simple” math challenge-question being suggested?

Best wishes Peter


Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


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

Sounds interesting. And could be a useful alternative to other captchas.

On 15 Mar 2009, at 04:21, email@hidden wrote:

… make sure the form is in set out in the order tou ant the data
processed
you should see the email data also set out in this order.

On the subject of e-mail reply subject order, I use PHP FBF and others
and I’ve found that adjusting the layer order of fields, top to
bottom, produces the order I want.

Colin


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

On the subject of e-mail reply subject order, I use PHP FBF and others
and I’ve found that adjusting the layer order of fields, top to
bottom, produces the order I want.

Also bear in mind that if you construct the form within a table than the tab order etc will follow the natural flow down through the table with the added benefit of keeping all your fields aligned to one another.

David


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

Peter - just a quick note about your form (referenced above)

Your first name field is called firstname and your family name field is called name you would be better to distinguish the family name field and call it surname or lastname and then you wont get the same autocomplete info in those 2 fields.

David


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

on 15/03/2009 10:47, DeltaDave at email@hidden wrote:

Peter - just a quick note about your form (referenced above)

Your first name field is called firstname and your family name field is called
name you would be better to distinguish the family name field and call it
surname or lastname and then you wont get the same autocomplete info in those
2 fields.

Thanks, I did have it like that, but following the instructions about Tim’s
Action the webpage suggests the two special named fields are “email” and
“name”, to quote:

“The form names ‘name’ and ‘email’ (without the quotes) have special values.
If the PHP detects that they are both present (and the email is of a valid
format) it will generate a mail message that appears to have come directly
from the user Š”

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


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

In your form, then, you could construct that field on the fly using
JavaScript to concatenate the first_name and last_name fields in the
onsubmit event. Your form handler would get all three, but the user
could see and use the first and last independently. Of course you
could just put a single Name field in there and not bother trying to
split them apart until later.

Form Setup / Extended:

name: onsubmit

value: return makeName(this);

Somewhere in the head of the page:

<script type="text/javascript">
function makeName(theForm){
	var name = theForm.first_name.value +
		' ' +
		theForm.last_name.value;
	var field = new Element('input');
	field.type = 'hidden';
	field.name = 'name';
	field.value = name;
	theForm.addChild(field);
	return theForm.submit();
}
</script>

I haven’t tested this, but it should work ok. Naturally, if it fails,
the fallback will be for the mail to appear to come from the server,
but to still contain the data entered in the form fields.

Walter

On Mar 16, 2009, at 12:06 PM, Peter Tucker wrote:

“The form names ‘name’ and ‘email’ (without the quotes) have special
values.
If the PHP detects that they are both present (and the email is of a
valid
format) it will generate a mail message that appears to have come
directly
from the user …”


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