Matt,

Try something like this (as well as you dynlayer stuff, obviously)

<script language="Javascript">
function showFormResults ( )
{
  // "is" detects browser type

  var outString = "" , thisForm ;

  if ( is.ns ) thisForm = helloLayer.doc.forms[0] ;
  else if ( is.ie ) thisForm = helloLayer.doc.forms[count-1];

  for ( var loop = 0 ; loop < thisForm.elements.length ; loop++ ) outString += thisForm.name + ":" + thisForm.elements[loop].name + ":" + thisForm.elements[loop].value + "\n" ; ;

  alert ( outString ) ;
}
</script>

and in the body of the document ...

<body>
<a href="#" >Go!</a>
</body>

Hope this helps ....

Mark Pratt

p.s. Maybe the if IE then do this / if NS then do this should be hidden away in a library so the form(s) on dynlayers can be accessed more cleanly????

Matt Fair wrote:

Hello, I would like to know if I am able to access and set the values in
a form.
I am able to do this if the form is actually hard coded in html, but I
want to do this with a dynLayer.
For example:
helloLayer = new DynLayer(null, 1,1,100,100, 'red')
helloLayer.setHTML("<form name=\"helloform\">" +
                                                "<input type=\"text\"
name=\"hello\" value=\"hello world\">" +
                                           "</form>")
DynAPI.document.addChild(helloLayer)

I would like to access the text field to get "hello world" and be able
to set it a different value.
So far I have not been able to figure this out.

Thanks in advance,
Matt

_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help

Reply via email to