How to get the unique identifier of an inline Submit button

I was trying to show a quick and easy example of how to put a cover
element over a form once it has been submitted. The first tool that
came to mind was my Observer Action. It worked fine on a Submit button
as long as I had drawn that Submit button on the page as a layered
object. But when I tried to test it on an inline button, it failed
miserably, because the object it was attached to didn’t have an ID.

So I tried to sort this using the technique I use in other Actions to
identify the unidentifiable:

var thisItem = fwDocument.fwTags.fwFind(fwItem);
if (thisItem){
	if(thisItem.id == undefined) {
		thisItem['id'] = fwQuote(thisItem.toString());
...

The button just never showed up at all in this case. I used an alert
to determine that the if(thisItem) was never returning true, so the
element was simply not being plucked out of the tags.

When I made the finder stricter:

fwDocument.fwTags.fwFind('input',fwItem)

I was able to find it, but I was not able to find any attribute that I
could use to identify the element. It lists within the page hierarchy
as item2, but none of the usual attributes would return that value.
Is there a particular way to identify an inline form element? And is
there a way to find anything in the tag stream without relying on
the tag name?

Thanks in advance,

Walter


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

Hi Walter,
This made me think for a while. The variable thisItem is returning a
pointer to the item action rather than the element it is attached to
(an input). As such it doesn’t have any properties of it’s own and
simply acts as a limpet attached to the parent.
If you change your search to;

var allItems = fwDocument.fwTags.fwFindAll(fwItem);

then you’ll get back an array of references to all of the items in the
selection. The action instance itself will be unnamed but the select
should return it’s own name.
Simply loop through the array and ignore the action itself to target
the select.

I’m sure there is a better way of doing this and I’m expecting to be
educated. :slight_smile:
Thanks,
Tim.

On 22 Oct 2010, at 14:12, Walter Lee Davis wrote:

I was trying to show a quick and easy example of how to put a cover
element over a form once it has been submitted. The first tool that
came to mind was my Observer Action. It worked fine on a Submit
button as long as I had drawn that Submit button on the page as a
layered object. But when I tried to test it on an inline button, it
failed miserably, because the object it was attached to didn’t have
an ID.

So I tried to sort this using the technique I use in other Actions
to identify the unidentifiable:

var thisItem = fwDocument.fwTags.fwFind(fwItem);
if (thisItem){
	if(thisItem.id == undefined) {
		thisItem['id'] = fwQuote(thisItem.toString());
...

The button just never showed up at all in this case. I used an alert
to determine that the if(thisItem) was never returning true, so the
element was simply not being plucked out of the tags.

When I made the finder stricter:

fwDocument.fwTags.fwFind(‘input’,fwItem)

I was able to find it, but I was not able to find any attribute that
I could use to identify the element. It lists within the page
hierarchy as item2, but none of the usual attributes would return
that value. Is there a particular way to identify an inline form
element? And is there a way to find anything in the tag stream
without relying on the tag name?

Thanks in advance,

Walter


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

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


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

That’s really weird, because when I use that exact same construction
when I have attached the Action to a DIV, it does return the item the
Action is attached to. I could see your point if it was an inline
Action-Item, but this is an Item-Action, attached to something.

I’ll give this method a try later.

Walter

On Oct 22, 2010, at 9:41 AM, Tim Plumb wrote:

This made me think for a while. The variable thisItem is returning a
pointer to the item action rather than the element it is attached to
(an input).


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