[Pro] Adding a class to a generated tag

Hi!

A want to write an action that generates a form tag to wrap around a div.

So, I’ve created an item-action, and used fwAddEnclosing(“form”, true).

So far so good. I can set the Name, Action, ID, Method, etc., but, for the life of me, I can’t get it so set the class.

I thought this would work:
formTag.class = fwQuote(fwParameters[“Form Class”].fwValue);

But Freeway kicks out an interpreter error: ‘missing name after . operator’. I’ve checked, and it’s the .class that it doesn’t like. If I set it to ‘.className =’ it works (but the attribute className is no use to me).

Can anyone point me in the right direction please?

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Hi Tim!

I can’t see any content in your post - was there any?

Cheers, Ian


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Hi Ian,
I’m not sure why that didn’t show up on FW Talk. Anyway hopefully here it is again…

Yes this is one of those things that trips everyone up.

Try:

formTag[“class”] = fwQuote(fwParameters[“Form Class”].fwValue);

Regards,
Tim.

On 1 Mar 2017, at 20:36, Ian Webb email@hidden wrote:

Hi Tim!

I can’t see any content in your post - was there any?

Cheers, Ian


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Class is a reserved word, so you have to use the alternate (square bracket) syntax to set it. Try formTag['class'] = fwQuote(fwParameters["Form Class"].fwValue);

Walter

On Mar 1, 2017, at 11:33 AM, Ian Webb email@hidden wrote:

Hi!

A want to write an action that generates a form tag to wrap around a div.

So, I’ve created an item-action, and used fwAddEnclosing(“form”, true).

So far so good. I can set the Name, Action, ID, Method, etc., but, for the life of me, I can’t get it so set the class.

I thought this would work:
formTag.class = fwQuote(fwParameters[“Form Class”].fwValue);

But Freeway kicks out an interpreter error: ‘missing name after . operator’. I’ve checked, and it’s the .class that it doesn’t like. If I set it to ‘.className =’ it works (but the attribute className is no use to me).

Can anyone point me in the right direction please?

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Hi Tim and Walter!

Thanks for this. I was nearly there - I’d left the ‘.’ in before [‘class’].

I’ve posted the action to Actionsforge now: http://www.actionsforge.com/actions/form-in-div-table

Thanks again both.

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

This looks excellent. Minor word-geek complaint – the word you want is deprecated (no longer in common use) rather than depreciated (lost some of its value).

Walter

On Mar 2, 2017, at 4:41 AM, Ian Webb email@hidden wrote:

Hi Tim and Walter!

Thanks for this. I was nearly there - I’d left the ‘.’ in before [‘class’].

I’ve posted the action to Actionsforge now: http://www.actionsforge.com/actions/form-in-div-table

Thanks again both.

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Minor word-geek complaint — the word you want is deprecated (no longer in common use) rather than depreciated (lost some of its value).

Thanks Walter - I dread to think of the number of times I must have misused depreciated over the years!

Still, you live and you learn…

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options