With markup as invalid as that, it's no surprise that elements are not where
you expect them in to be in the DOM. A FORM element can't be sandwiched in
between a TABLE and TR like that. So the browser tries to turn this into
something it can work with. It may shuffle things around, or just put up
with the "incorrect" structure, or whatever. And yeah, it may be different
from one browser to another.

But I think you mentioned that you're stuck with working with the HTML as it
is, so lucky you, you get to deal with the aftermath. :-(

-Mike

> ok, i'm not sure if this is the easiest way, however, this is 
> how I got the form action in the following HTML:
> 
> <table width="460" border="0" cellspacing="0" cellpadding="0">
>       <tr valign="top">
>               <td>
>                       <table width="100%" border="0" 
> cellpadding="0" cellspacing="0">
>                               <tr>
>                                       <td valign="top" colspan="2">
>                                               <table 
> border="0" cellspacing="1" cellpadding="3" width="100%">
>                                                       <form 
> Method="Post" Action="phoenix.zhtml?c=69181&p=IROL-
> irhome&t=SwitchQuote" >
>                                                               
> <tr class="modBgQuoteShrtTicker">
>                                                               
>       <td colspan="4" nowrap="nowrap">
>                                                               
>               <span class="modQuoteShrtTicker">
>                                                               
>                       <Select name="control_Symbol"
> ONCHANGE="updateQuote(this);">
>                                                               
>                               <option value="1" 
> SELECTED="">opt 1</option>
>                                                               
>                               <option value="2">opt 2</option>
>                                                               
>                       </Select>
>                                                               
>               </span>
>                                                               
>       </td>
>                                                               </tr>
>                                                       </form>
> 
> I used:
> 
> var formAction = $
> (elm).parents('table:first').children("form:first").attr("action");
> 
> For some reason, it misses the form object on the way back 
> using "parents" so i move forward after hitting the FORM's 
> parent to get the form.  Not sure if this is browser 
> specific, but definitely a headache. (and the terrible HTML 
> syntax doesn't help either)

Reply via email to