Ivan Sergio Borgonovo ha scritto:
I think FAPI does some check on the existence of a '#type'=> 'submit'. Furthermore to get the onClick event you don't have to wrap an anchor around the button you'd just have to add attributes to the form element.
an anchor around the button ??? I don't have an anchor around the button. I want to eliminate the button and leave only the "<a href....> >> </a>" (or imagine a GIF). I can delete it via unset but then the form does not works. So I can delete it via CSS (display:none), but I ak myself why this. I think that there is some type of check, too.
Beware of the document.getElement... I'm not a js guru but it may not work on all browsers (the DOM is not the same in IE/ffox), you'd need a wrapper. I think all the JS goodies that comes with drupal should have one.
The code is not tested in IE (for the moment is only a test).
Actually... if you dig into jQuery you may discover there is already something ready to do exactly what you'd like in a more drupalish way.
Do you know some exact url ?
M.