[thelist] [JS] Safari 1.0.3 on OSX 10.2.x and JS

Joshua Olson joshua at waetech.com
Thu May 5 22:30:12 CDT 2005


> -----Original Message-----
> From: Sam Foster
> Sent: Thursday, May 05, 2005 10:50 PM
> 
> 
> >>What's wrong with this.form.action ? That's always worked, 
> and should 
> >>continue to for the forseable.
> >>Sam,
> >>    
> >>
> 
> >>form.action.value is potentially ambiguous--eg, you have an 
> element named
> >>"action".  It's considered best-practice to use the 
> "attributes" collection
> >>when modifying the attributes within the form tag and the "elements"
> >>collection when referring to form elements.
> >>    
> >>
> fair point. Let me (or thelist) know how you resolve it if you do

Sam,

I ended up setting the attribute both ways...  

onclick="this.form.setAttribute('action', 'blah.htm');
this.form.attributes.action.value = 'blah.htm');"

When I want to to read the value, I use the code from the tip I posted last
night:

    function formAction(form)
    {
      try {
        return form.attributes.action.value;
      }
      catch(e)
      {
        return form.getAttribute('action');
      }
    }

<><><><><><><><><><>
Joshua L. Olson
WAE Tech Inc.
http://www.waetech.com/
Phone: 706.210.0168 

Monitor bandwidth usage on IIS6 in real-time:
http://www.waetech.com/services/iisbm/




More information about the thelist mailing list