Click to See Complete Forum and Search --> : Overlapped tags with onClick()


Paul123
03-18-2003, 07:40 AM
Here`s the situation.
I put a link into the table`s cell.

I proceed onclick events for both the cell and the link.
They both result the same action that submits a form. Actually, i need the link only for compatibility with older browsers.

The problem occures when the link is clicked (in some newer browsers, like IE) the form is submited twice.
How could i avoid this "double submitions" without detecting the version of browser?

Here is the example which causes the problem
<td onClick= "document.FormName.submit();return false;">
<a href="" "onClick="document.FormName.submit();return false;">test submit</a></td>
...

Thanks in advance for any suggestion

gil davis
03-18-2003, 07:52 AM
Since there is little doubt that the anchor will be depricated, I'd just ditch the TD onclick. Otherwise you'll have to add code to see what got clicked and only allow the one.