Why won't that work for you?

The easiest way to find out is to do something like this:

<script>
function dumpit(obj) {
  var output = '<table>';
  for (var prop in obj) {
    output += '<tr><td>' + prop + '</td><td>';
    if (typeof(obj[prop]) == 'object') {
      output += '[object]';
    }
    else {
     output += obj[prop];
    }
    output += '</td></tr>';
  }
  output += '</table>';
  document.getElementById('dumper').innerHTML = output;
}


</script>


<div id="dumper"></div>

<form action="index.cfm" method="post" name="foo" onclick="dumpit(this)">
   Click to view DOM info.
</form>

Taco Fleur wrote:

PS. I know it can be done like this.form or this.formName but that's not what I am after.. ;-))

    -----Original Message-----
    *From:* Taco Fleur
    *Sent:* Friday, 21 November 2003 10:15 AM
    *To:* CFAussie Mailing List
    *Subject:* [cfaussie] [OT] JS Object

Can you derive the form name from an object?

    For example, let's say I am calling a JS function within a form, I
    pass this function the object it is called from ie. (this), within
    the function can I now derive the form name from this object?

    *Taco Fleur
    07 3535 5072*
    Tell me and I will forget
    Show me and I will remember
    Teach me and I will learn

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

-- Stephen Milligan Software Architect for http://www.bestrates.com.au MSN: [EMAIL PROTECTED]



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to