Adding a Form Name

Is it possible to add a form name in Freeway6

I’m using CSS styled text for the submit button and onclick=“submit();” works in the link but not in Firefox or IE.

If i use onclick=“document.myform.submit();” and add name='myform" to the form tag it works just fine.

I did see a reply from Walter on a previous question some time ago where he suggested the use of forms[0] in the place of the form name and this works too in both Firefox and IE.

Should I just go with that option or is the addition of form name via Freeway feasible.

Many thanks.

Al.


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

In the Form Setup dialog, you will find an Extended sub-dialog that will let you add any name/value pair you like to the form tag. So there, you would type name in the Name field and myform in the Value field.

You may also use document.forms[0] in most cases, since Freeway won’t allow more than a single form per page without extra Actions applied to the page + elements. If you had more than one form (maybe you used Simple Search and PHP Feedback Form on the same page, using the Multiple Forms Suite Action to facilitate this) then you could try out the other indices of that array (document.forms[1], [2], etc.) to see which one you needed. This array is based on source code order, with the first form on the page being index 0.

Walter

On Apr 8, 2013, at 8:57 AM, Alan Herbert wrote:

Is it possible to add a form name in Freeway6

I’m using CSS styled text for the submit button and onclick=“submit();” works in the link but not in Firefox or IE.

If i use onclick=“document.myform.submit();” and add name='myform" to the form tag it works just fine.

I did see a reply from Walter on a previous question some time ago where he suggested the use of forms[0] in the place of the form name and this works too in both Firefox and IE.

Should I just go with that option or is the addition of form name via Freeway feasible.

Many thanks.

Al.


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 alan,
Try

this.form.submit();

which should locate the form associated with the element clicked (the submit button) and submit it.
Regards,
Tim.

On 8 Apr 2013, at 13:57, Alan Herbert wrote:

If i use onclick=“document.myform.submit();” and add name='myform" to the form tag it works just fine.


Experienced Freeway designer for hire - http://www.freewayactions.com


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

Hi guys and thanks for the super fast response.

Walter, I discovered the Form Setup dialogue box under the Page menu (something new for me again) and added the name → name and value → superform to the Extend section.

As it did not add the name or value to the Form tag, i can only image i did something wrong or missed something out. How does it know which form to add the value pair to if there were more than one form on the page? I’m obviously missing something here.

Tim, i tried your this.form.submit(); but it wasn’t happy with that either i’m afraid.

When I apply the link to the text for submission, i add # as the link and use extend to include onclick etc…

You can see the form here: http://www.nialtoservices.co.uk/rmdecor/contact-us.html if it helps.

Thanks for your support.

Al.


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

I discovered the Form Setup dialogue box

That should only be used if you are using your own form handler as it will be ignored using the Send Form action as all the info is contained within the action and form items.

Note that there are a lot of Browsers out there that do not support Placeholder text - a visitor using one of them will have no clue what each form field requires. You should always have labels for your fields.

David


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

Hi David.

Just read this after replying to your previous response on the other thread. I realised the issues with other browsers and placeholder text, which led me to discover placeholder.js.

It seems to solve the problem nicely, again it could probably be used with modernizr when I figure that out.

Thank you for pointing out the issue. I need to go and update a couple of other forms today so if you are aware of problems using placeholder.js I’d love to hear in order to seek an alternative.

Cheers.

Al.


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

Walter has his own placeholder-shiv with Prototype and jquery versions https://github.com/walterdavis/placeholder-shiv.

Todd
http://xiiro.com


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

Hi Todd.

Thanks for that tip. I didn’t realise Walter had fixed the problem. I did a quick search on Freewaytalk but couldn’t see anything for placeholder text missing.

I’ll have a go with Walters methods on the other sites. It seems to require 2 files as opposed to the single placeholder.js file. Apart from the fact it’s written by Walter and therefore no doubt pretty slick, are there advantages.

Cheers.

Al.


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

It requires two files because it uses Prototype.js to simplify the cross-browser coding. This makes it a good citizen in Freeway, too, because all of the effects in the various FX Actions and Rollover are based on Prototype and Scriptaculous, and are thus not compatible with jQuery.

It could probably be rewritten to not depend on an external library, but I tend to start with Prototype because it means the amount of code I have to write is much shorter and more expressive. For example, which of these would you rather pick through and attempt to understand?

var items = document.getElementsByTagName('a');
for(var i = 0; i < items.length; i++){
	if(items[i].className.toString().match(/foo/)){
		items[i].className += ' bar';
	}
};

or this, with Prototype along for the ride:

$$('a.foo').invoke('addClassName', 'bar');

Seriously, there’s no contest in my mind.

Walter

On Apr 9, 2013, at 2:55 AM, Alan Herbert wrote:

Hi Todd.

Thanks for that tip. I didn’t realise Walter had fixed the problem. I did a quick search on Freewaytalk but couldn’t see anything for placeholder text missing.

I’ll have a go with Walters methods on the other sites. It seems to require 2 files as opposed to the single placeholder.js file. Apart from the fact it’s written by Walter and therefore no doubt pretty slick, are there advantages.

Cheers.

Al.


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.

As you say, when it comes to reading back or searching through the code, it’s a no brainer.

So, as we want to be good Freeway Citizens, I have now implemented your Placeholder Text fix in a couple of other sites - and it goes without saying that it works a charm.

This is what makes Freeway so great in my mind, the people in this forum that share all this amazing know how. I follow the comings and goings on FreewayTalk, and even have the FreewayTalk forum view fixed as the background in my email client (postbox) as I’m keen to learn whats new, but i still managed to miss this golden little gem.

Cheers.

Al.


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